Browse Source

setup postactivate for virtualenvwrapper

pull/1/head
Brett Langdon 12 years ago
parent
commit
2f88bfd81f
2 changed files with 27 additions and 5 deletions
  1. +11
    -0
      postactivate
  2. +16
    -5
      setup.sh

+ 11
- 0
postactivate View File

@ -0,0 +1,11 @@
#!/bin/zsh
# This hook is run after every virtualenv is activated.
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
if [ -d ~/Magnetic/$proj_name ]
then
cd ~/Magnetic/$proj_name
elif [ -d ~/src/$proj_name ]
then
cd ~/src/$proj_name
fi

+ 16
- 5
setup.sh View File

@ -29,8 +29,8 @@ for file in $files; do
then
echo "Moving $file to $olddir/$file"
mv ~/.$file $olddir
echo "Creating symlink to $file in home directory."
ln -s $dir/$file ~/.$file
echo "Creating symlink to $file in home directory."
ln -s $dir/$file ~/.$file
fi
done
@ -40,12 +40,23 @@ sudo pip install elpy rope
echo "Installing Virtualenvwrapper"
sudo pip install virtualenvwrapper
source ~/.zshrc
echo "Setting up $WORKON_HOME"
WORKON_HOME=~/environments
mkdir -p WORKON_HOME
file="postactivate"
if [ -e $file ]
then
echo "Moving $WORKON_HOME/$file to $olddir/$file"
mv $WORKON_HOME/$file $olddir
echo "Creating symlink to $file in $WORKON_HOME directory."
ln -s $dir/$file $WORKON_HOME/$file
fi
echo "Setting up GOPATH"
mkdir -p $GOPATH
echo "Setting up CHEF_PATH"
mkdir -p $CHEF_PATH
echo "Setting up WORKON_HOME"
mkdir -p $WORKON_HOME
echo "Source ~/.zshrc"
source ~/.zshrc

Loading…
Cancel
Save