From 4017615af38bf7c1e00ca906c20e0479309a2a85 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Johnsen Date: Sat, 28 Dec 2024 12:47:53 +0100 Subject: [PATCH] refactor: use elif when checking for ` -m pip ` in command to be executed. This is a logical change. If the command is `pip install ...`, then you don't need to look for `python -m pip install ...` in the same command. Either you have `pip install ...` or `python -m pip install ...` or something completely different. --- pyenv.d/exec/pip-rehash.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyenv.d/exec/pip-rehash.bash b/pyenv.d/exec/pip-rehash.bash index a90317fa..02a90a56 100644 --- a/pyenv.d/exec/pip-rehash.bash +++ b/pyenv.d/exec/pip-rehash.bash @@ -4,10 +4,9 @@ PYENV_REHASH_COMMAND="${PYENV_COMMAND##*/}" # Remove any version information, from e.g. "pip2" or "pip3.4". if [[ $PYENV_REHASH_COMMAND =~ ^(pip|easy_install)[23](\.[0-9]+)?$ ]]; then PYENV_REHASH_COMMAND="${BASH_REMATCH[1]}" -fi # Check for ` -m pip ` in arguments -if [[ "$*" =~ [[:space:]]-m[[:space:]]pip[[:space:]] ]]; then +elif [[ "$*" =~ [[:space:]]-m[[:space:]]pip[[:space:]] ]]; then PYENV_REHASH_COMMAND="pip" fi