Skip to content

Instantly share code, notes, and snippets.

@erdii
Last active July 18, 2020 22:11
Show Gist options
  • Save erdii/fd458d862020e4896e5d7c993e2d5577 to your computer and use it in GitHub Desktop.
Save erdii/fd458d862020e4896e5d7c993e2d5577 to your computer and use it in GitHub Desktop.
import functions
ensure_pip() {
pip show "$1" > /dev/null || pip install "$1"
}
ensure_venv() {
if [[ ! -d "$1" ]]
then
python -m venv "$1"
fi
}
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