bashrc/.bashrc.d/vactivate.bash

11 lines
215 B
Bash
Raw Normal View History

# shellcheck disable=SC1090
vactivate() {
local path=~/.venv/$1
if [[ ! -d $path ]]; then
python -m venv --prompt "venv: $1" --system-site-packages "$path"
fi
source "$path"/bin/activate; bash; deactivate
}