diff options
author | 2013-02-06 11:44:04 +0100 | |
---|---|---|
committer | 2013-02-06 11:44:04 +0100 | |
commit | 0445ad9f57b2402bb0030046c96dce6a3745d989 (patch) | |
tree | 55e654a7724c8531b2717e29750089f11d471335 /.zsh/functions/venv | |
parent | dca5bacd6c50a2b1d3929fd1480a1836f5dc7e13 (diff) | |
download | dotfiles-0445ad9f57b2402bb0030046c96dce6a3745d989.tar.gz dotfiles-0445ad9f57b2402bb0030046c96dce6a3745d989.zip |
zsh: Add venv function
This enables or lists virtual environments
Diffstat (limited to '.zsh/functions/venv')
-rw-r--r-- | .zsh/functions/venv | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/.zsh/functions/venv b/.zsh/functions/venv new file mode 100644 index 0000000..49564ac --- /dev/null +++ b/.zsh/functions/venv @@ -0,0 +1,15 @@ +# -*- mode: sh; -*- +if [ "${#}" -eq 1 ]; then + venv_activate="$HOME/.virtualenv/$1/bin/activate" + + if [ -r "$venv_activate" ]; then + source $venv_activate + else + echo "$1 is not a know virtual environment" + fi +else + echo "Virtual environments: " + for itm in ~/.virtualenv/*; do + echo " $(basename $itm)" + done +fi |