Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

predefined variable error on tasks.json #6623

Closed
sbwtw opened this issue May 22, 2016 · 5 comments
Closed

predefined variable error on tasks.json #6623

sbwtw opened this issue May 22, 2016 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues verified Verification succeeded
Milestone

Comments

@sbwtw
Copy link

sbwtw commented May 22, 2016

  • VSCode Version: 1.1.1
  • OS Version: Archlinux

Steps to Reproduce:

  1. create new project and set tasks.json
  2. command is set to echo, and args set to ["${file}", "${fileBaseName}"]
  3. run task with some file, like a.txt.
  4. ${file} and ${fileBaseName} are same string
@dbaeumer dbaeumer added the tasks Task system issues label May 23, 2016
@dbaeumer dbaeumer added this to the May 2016 milestone May 23, 2016
@dbaeumer dbaeumer added the bug Issue identified by VS Code Team member as probable bug label May 23, 2016
@dbaeumer
Copy link
Member

This is what I see under Windows:

running command> echo p:\mseng\VSCode\Playgrounds\tasks\.vscode\tasks.json, tasks.json
"p:\mseng\VSCode\Playgrounds\tasks\.vscode\tasks.json, tasks.json"

Checking under Linux now.

@dbaeumer
Copy link
Member

The tasks.json is:

{
    // See http://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "command": "echo",
    "isShellCommand": true,
    "echoCommand": true,
    "args": ["${file}, ${fileBasename}"]
}

Note that the var for the basename is ${fileBasename}

@dbaeumer
Copy link
Member

dbaeumer commented May 25, 2016

Same is true for Linux (Elementary OS).

capture

@dbaeumer
Copy link
Member

I am closing the issue. Please ping with steps to reproduce if you still see this.

@dbaeumer
Copy link
Member

We get the base name using and node function which should be independent of the Linux you use. That is why I closed it. To double check you could execute the following snippet in a node environment:

var path = require('path');
path.basename('/home/dirkb/test.txt');

This should print:

'test.txt'

@dbaeumer dbaeumer added the verified Verification succeeded label May 27, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

2 participants