This commit is contained in:
Reinier Criel 2025-11-06 08:32:25 -08:00
parent fa4c46c23d
commit f400c5576a
12 changed files with 59 additions and 213 deletions

View file

@ -71,26 +71,10 @@ function pip3() {
# `python -m pip`, `python -m pip3`.
function python() {
if [[ "$1" == "-m" && "$2" == pip* ]]; then
local mod="$2"
shift 2
if [[ "$mod" == "pip3" ]]; then
wrapSafeChainCommand "pip3" "aikido-pip3" "$@"
else
wrapSafeChainCommand "pip" "aikido-pip" "$@"
fi
else
command python "$@"
fi
wrapSafeChainCommand "python" "aikido-python" "$@"
}
# `python3 -m pip`, `python3 -m pip3'.
function python3() {
if [[ "$1" == "-m" && "$2" == pip* ]]; then
shift 2
# python3 always uses pip3, regardless of whether user types `pip` or `pip3`
wrapSafeChainCommand "pip3" "aikido-pip3" "$@"
else
command python3 "$@"
fi
wrapSafeChainCommand "python3" "aikido-python3" "$@"
}