Created
January 29, 2023 19:29
-
-
Save pzelnip/6265212ad8190e2202d7474f05f7384a to your computer and use it in GitHub Desktop.
Example of using variables to minimize duplication of path to Python Virtual Env in VS Code tasks.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"options": { | |
"env": { | |
// Path to VENV from home directory | |
"PYTHON_VENV": "/.envs/myvirtualenv/bin/activate" | |
} | |
}, | |
"tasks": [ | |
{ | |
"label": "Run Make in VENV", | |
"type": "shell", | |
"command": "source ${userHome}$PYTHON_VENV && make some-target", | |
"presentation": { | |
"focus": true, | |
}, | |
"problemMatcher": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment