[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

@ -0,0 +1,8 @@
Development
============
1. virtual_env pip
if virtual env path is writeable by user (e.g. $HOME), not need sudo.
export VIRTURL_ENV="path"

View file

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