Created
November 5, 2013 19:46
-
-
Save cwood/7324980 to your computer and use it in GitHub Desktop.
Upgrade a package for a bunch of virtualenvs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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