Files
bash-it/plugins/available/virtualenv.plugin.bash
John D Pell 470341b23a Drop basename in favor of Bash strings
Convert `var=$(basename $file)` to `var="${file##*/}"`
2021-09-16 16:59:02 -07:00

44 lines
867 B
Bash

# make sure virtualenvwrapper is enabled if available
cite about-plugin
about-plugin 'virtualenvwrapper and pyenv-virtualenvwrapper helper functions'
if _command_exists pyenv; then
pyenv virtualenvwrapper
else
[[ `which virtualenvwrapper.sh` ]] && . virtualenvwrapper.sh
fi
function mkvenv {
about 'create a new virtualenv for this directory'
group 'virtualenv'
local cwd="${PWD##*/}"
mkvirtualenv --distribute "$cwd"
}
function mkvbranch {
about 'create a new virtualenv for the current branch'
group 'virtualenv'
local cwd="${PWD##*/}"
mkvirtualenv --distribute "${cwd}@${SCM_BRANCH}"
}
function wovbranch {
about 'sets workon branch'
group 'virtualenv'
local cwd="${PWD##*/}"
workon "${cwd}@${SCM_BRANCH}"
}
function wovenv {
about 'works on the virtualenv for this directory'
group 'virtualenv'
workon "${PWD##*/}"
}