zsh:funcs: Add create_venv

This commit is contained in:
2021-07-27 03:54:10 +02:00
parent 89d8d83410
commit 1c36ae8cac

View File

@@ -450,3 +450,13 @@ unbkp() {
fi fi
done done
} }
# Create a virtual environment for python including a .envrc that loads the venv
create_venv() {
[[ ! -e venv ]] || return 0
python -m venv venv
if (( $+commands[direnv] )); then
ln -s ~/.local/share/direnv/templates/python-venv.envrc .envrc
direnv allow
fi
}