Skip to content

Instantly share code, notes, and snippets.

@rafacv
Created July 22, 2016 20:28
Show Gist options
  • Save rafacv/f8edbae533e7e26182c2417bd91411ce to your computer and use it in GitHub Desktop.
Save rafacv/f8edbae533e7e26182c2417bd91411ce to your computer and use it in GitHub Desktop.
Simple bash/zsh functions to use VirtualEnv
# VirtualEnv
function venv() {
if [ -n "$1" ]; then
venv=$1
shift
if [ ! -d ~/.venv/$venv ]; then
virtualenv ~/.venv/$venv $*
fi
source ~/.venv/$venv/bin/activate
fi
}
function lsvenv() {
ls -x1 ~/.venv/
}
function rmvenv() {
if [ -n "$1" ]; then
if [ -d ~/.venv/$1 ]; then
rm -rf ~/.venv/$1
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment