bashrc/.bashrc.d/vactivate.sh

9 lines
182 B
Bash

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
}