Created
February 17, 2019 23:52
-
-
Save piersharding/288aa79601168ebf3ca3cdd46de087f1 to your computer and use it in GitHub Desktop.
Wrapper for .env vars for vscode-python broken-ness - https://github.com/Microsoft/vscode-python/issues/944
This file contains hidden or 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
#!/bin/sh | |
# environment fix for vscode-python problems https://github.com/Microsoft/vscode-python/issues/944 | |
# stick this in ${workspaceFolder}/venv/bin/python.sh and adjust settings.json: | |
# "python.pythonPath": "${workspaceFolder}/venv/bin/python.sh", | |
# "python.envFile": "${workspaceFolder}/dev.env", | |
# "python.terminal.activateEnvironment": true, | |
# "python.venvPath": "${workspaceFolder}/venv" | |
# ... | |
echo "Current path is " `pwd` | |
# load environment variables | |
if [ -f .env ]; then | |
export $(grep -v '^#' .env | xargs) | |
fi | |
venv/bin/python $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment