4

I'm asking because I don't know if it is possible. But, I'm using VSCode to run a few makefiles.

My tasks.json:

{
"version": "0.1.0",
"command": "sh",
"args": ["-c"],
"isShellCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"tasks": [
    {
        "taskName": "CTRL + SHIFT _ B",
        "isBuildCommand": true,
        "args": ["$make run-db"]
    },
    {
        "taskName": "run",
        "args": ["make -C ${fileDirname} run;"]
    },
    {
        "taskName": "install",
        "args": ["make -C ${fileDirname} install;"]
    },
    {
        "taskName": "test",
        "args": ["make -C ${fileDirname} test;"]
    }
]
}

I'd like to know If it is possible to create just one run make line, instead of creating one method for each task in my makefile, I just pass the extra argumment in the vscode command pallet(EX: ctrl+p task make install)

{
    "taskName": "make",
    "args": ["make -C ${fileDirname} $Method;"]
},
Felipe Santiago
  • 394
  • 5
  • 15
  • Possible duplicate of [VScode: Defining own variables in tasks.json](https://stackoverflow.com/questions/44303316/vscode-defining-own-variables-in-tasks-json) – Gyuri Feb 04 '19 at 21:14

1 Answers1

0

you can probably use environment variable

"env": {
     "NODE_ENV": "development"
},

as in this exemple

negstek
  • 538
  • 6
  • 23