diff --git a/postactivate b/postactivate new file mode 100755 index 0000000..054b2bf --- /dev/null +++ b/postactivate @@ -0,0 +1,8 @@ +#!/usr/bin/zsh +# This hook is run after every virtualenv is activated. + +proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}') +if [ -d ~/src/$proj_name ] +then + cd ~/src/$proj_name +fi diff --git a/setup.sh b/setup.sh index aaa8a19..f9488ae 100755 --- a/setup.sh +++ b/setup.sh @@ -34,5 +34,11 @@ for file in $files; do fi done +echo "Setting up virtualenvwrapper" +echo "Creating ~/.env" +mkdir -p ~/.env +echo "Moving postactivate into place" +ln -s $dir/postactivate ~/.env/postactivate + echo "Source ~/.zshrc" . ~/.zshrc