Last active
July 18, 2020 22:11
-
-
Save erdii/fd458d862020e4896e5d7c993e2d5577 to your computer and use it in GitHub Desktop.
import functions
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
ensure_pip() { | |
pip show "$1" > /dev/null || pip install "$1" | |
} |
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
ensure_venv() { | |
if [[ ! -d "$1" ]] | |
then | |
python -m venv "$1" | |
fi | |
} |
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
load_envfile() { | |
# load envvars assignments from file | |
# but filter out lines starting with a # | |
export $(grep -v '^#' "$1" | xargs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment