From bbd8f2c01e4f3b2f382213840fe62faefdee35a2 Mon Sep 17 00:00:00 2001 From: Lars Fronius Date: Tue, 9 May 2017 12:43:51 +0200 Subject: [PATCH] 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`. --- pyenv.d/exec/pip-rehash/pip | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyenv.d/exec/pip-rehash/pip b/pyenv.d/exec/pip-rehash/pip index 8f663726..28590aad 100755 --- a/pyenv.d/exec/pip-rehash/pip +++ b/pyenv.d/exec/pip-rehash/pip @@ -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"