[autosudo plugin] fix pip at virtual_env

This commit is contained in:
Guten 2011-05-31 08:51:38 +08:00
commit c890c7ea0d
2 changed files with 17 additions and 4 deletions

View file

@ -16,11 +16,16 @@ function clyde() {
esac
}
# special: virtual_env
function pip() {
case $1 in
install | uninstall ) sudo pip $* ;;
*) command pip $* ;;
esac
if [[ -n ${VIRTUAL_ENV+1} && -w $VIRTUAL_ENV ]] ; then
command pip $*
else
case $1 in
install | uninstall ) sudo pip $* ;;
*) command pip $* ;;
esac
fi
}
function npm() {