Skip to content

Commit

Permalink
Fixes pip-rehash to rehash if pip was called with a flag
Browse files Browse the repository at this point in the history
`pip -v install foobar` or `pip -q install foobar` did not trigger a rehash before. Now it should have the same behaviour as `pip install foobar`.
  • Loading branch information
LarsFronius authored May 9, 2017
1 parent 30212f0 commit bbd8f2c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pyenv.d/exec/pip-rehash/pip
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ STATUS=0

# Run `pyenv-rehash` after a successful installation.
if [ "$STATUS" == "0" ]; then
case "$1" in
"install" | "uninstall" ) pyenv-rehash;;
esac
for piparg in "$@"; do
case ${piparg} in
"install" | "uninstall" ) REHASH=0;;
esac
done
fi

if [ "$REHASH" == "0" ]; then
pyenv-rehash
fi

exit "$STATUS"

0 comments on commit bbd8f2c

Please sign in to comment.