Skip to content

Commit 70c813b

Browse files
authored
Update get_pip_version function to check for pip3
1 parent d97275c commit 70c813b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

cooldowns.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,20 @@ esac
6868
# ---------------------------------------------------------------------------
6969

7070
# Get pip version (e.g., "26.1.0" -> "26.1.0")
71-
# Returns empty string if pip is not installed
71+
# Returns empty string if neither pip nor pip3 is on PATH (e.g. Homebrew only ships pip3)
7272
get_pip_version() {
73-
if ! command -v pip &>/dev/null; then
73+
local pip_cmd=""
74+
if command -v pip &>/dev/null; then
75+
pip_cmd=pip
76+
elif command -v pip3 &>/dev/null; then
77+
pip_cmd=pip3
78+
else
7479
echo ""
7580
return 1
7681
fi
7782

7883
local version
79-
version=$(command pip --version 2>/dev/null | awk '{print $2; exit}')
84+
version=$(command "$pip_cmd" --version 2>/dev/null | awk '{print $2; exit}')
8085
echo "$version"
8186
}
8287

0 commit comments

Comments
 (0)