Skip to content

Instantly share code, notes, and snippets.

@cwood
Created November 5, 2013 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwood/7324980 to your computer and use it in GitHub Desktop.
Save cwood/7324980 to your computer and use it in GitHub Desktop.
Upgrade a package for a bunch of virtualenvs
#!/bin/zsh
autoload -U colors && colors
if [[ -z $1 ]]; then
read "upgradePackage?Which pacakge to upgrade? "
else
upgradePackage=$1
fi
VIRTUALENV_INSTALLS="/var/virtualenvs"
VIRTUALENV_HOMES=(`find $VIRTUALENV_INSTALLS -maxdepth 1 -type d`)
for virtualenv in $VIRTUALENV_HOMES; do
if [[ -e "$virtualenv/bin/activate" ]]; then
echo "Working on ${fg[blue]}${virtualenv}${reset_color}"
source $virtualenv/bin/activate
pip install --upgrade $upgradePackage
deactivate
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment