Fixes pip-rehash to rehash if pip was called with a flag

`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`.
This commit is contained in:
Lars Fronius 2017-05-09 12:43:51 +02:00 committed by GitHub
parent 30212f0054
commit bbd8f2c01e

View file

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