mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
[autosudo plugin] fix pip at virtual_env
This commit is contained in:
parent
04ec2f024f
commit
c890c7ea0d
2 changed files with 17 additions and 4 deletions
8
plugins/autosudo/README.md
Normal file
8
plugins/autosudo/README.md
Normal 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"
|
||||||
|
|
||||||
|
|
@ -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() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue