1 parent d97275c commit 70c813bCopy full SHA for 70c813b
1 file changed
cooldowns.sh
@@ -68,15 +68,20 @@ esac
68
# ---------------------------------------------------------------------------
69
70
# Get pip version (e.g., "26.1.0" -> "26.1.0")
71
-# Returns empty string if pip is not installed
+# Returns empty string if neither pip nor pip3 is on PATH (e.g. Homebrew only ships pip3)
72
get_pip_version() {
73
- if ! command -v pip &>/dev/null; then
+ 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
79
echo ""
80
return 1
81
fi
82
83
local version
- version=$(command pip --version 2>/dev/null | awk '{print $2; exit}')
84
+ version=$(command "$pip_cmd" --version 2>/dev/null | awk '{print $2; exit}')
85
echo "$version"
86
}
87
0 commit comments