Merge branch 'enhance-virtualenv'
commit
348b48cce5
|
|
@ -5,22 +5,42 @@ about-plugin 'virtualenvwrapper helper functions'
|
||||||
|
|
||||||
[[ `which virtualenvwrapper.sh` ]] && . virtualenvwrapper.sh
|
[[ `which virtualenvwrapper.sh` ]] && . virtualenvwrapper.sh
|
||||||
|
|
||||||
|
# default python version - use python2 to pick
|
||||||
|
# up Homebrew version if applicable
|
||||||
|
if hash brew 2>/dev/null && hash python2 2>/dev/null; then
|
||||||
|
PYVER="--python=`command -v python2`"
|
||||||
|
fi
|
||||||
|
|
||||||
function mkvenv {
|
function mkvenv {
|
||||||
about 'create a new virtualenv for this directory'
|
about 'create a new virtualenv for this directory'
|
||||||
group 'virtualenv'
|
group 'virtualenv'
|
||||||
|
|
||||||
cwd=`basename \`pwd\``
|
cwd=`basename \`pwd\``
|
||||||
mkvirtualenv $cwd
|
mkvirtualenv $PYVER $cwd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mkvenv3 {
|
||||||
|
about 'create a new virtualenv for this directory using python3'
|
||||||
|
group 'virtualenv'
|
||||||
|
|
||||||
|
PYVER="--python=`command -v python3`"
|
||||||
|
mkvenv
|
||||||
|
}
|
||||||
|
|
||||||
function mkvbranch {
|
function mkvbranch {
|
||||||
about 'create a new virtualenv for the current branch'
|
about 'create a new virtualenv for the current branch'
|
||||||
group 'virtualenv'
|
group 'virtualenv'
|
||||||
|
|
||||||
scm_prompt_info >/dev/null 2>&1
|
scm_prompt_info >/dev/null 2>&1
|
||||||
mkvirtualenv "$(basename `pwd`)@$SCM_BRANCH"
|
mkvirtualenv $PYVER "$(basename `pwd`)@$SCM_BRANCH"
|
||||||
|
}
|
||||||
|
|
||||||
|
function mkvbranch3 {
|
||||||
|
about 'create a new virtualenv for this directory using python3'
|
||||||
|
group 'virtualenv'
|
||||||
|
|
||||||
|
PYVER="--python=`command -v python3`"
|
||||||
|
mkvbranch
|
||||||
}
|
}
|
||||||
|
|
||||||
function wovbranch {
|
function wovbranch {
|
||||||
|
|
@ -37,3 +57,18 @@ function wovenv {
|
||||||
|
|
||||||
workon "$(basename `pwd`)"
|
workon "$(basename `pwd`)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mkve {
|
||||||
|
about 'create a new virtualenv with the specified name'
|
||||||
|
group 'virtualenv'
|
||||||
|
|
||||||
|
mkvirtualenv $PYVER $1
|
||||||
|
}
|
||||||
|
|
||||||
|
function mkve3 {
|
||||||
|
about 'create a new virtualenv with the specified name using python3'
|
||||||
|
group 'virtualenv'
|
||||||
|
|
||||||
|
PYVER="--python=`command -v python3`"
|
||||||
|
mkve $1
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue