1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 06:39:02 -08:00

invoke automamba from pippy if it exists (also affects pegg) (gross hack)

This commit is contained in:
Connor Olding 2024-03-21 14:03:02 -07:00
parent 76776c7b55
commit b5c5ebfded

View file

@ -8,10 +8,16 @@ pippy() { ### @-
### install Python packages using pip,
### but only update their dependencies as required.
### this uses [`maybesudo`](#maybesudo_-shmaybesudo) internally.
if [ -s ~/work/automamba ]; then
~/work/automamba --pip install --upgrade --upgrade-strategy only-if-needed --dry-run "$@"
confirm || return
~/work/automamba --pip install --upgrade --upgrade-strategy only-if-needed "$@"
return
fi
local sudo="$(has sudo || echo maybesudo_)"
"$sudo" python3 -m pip install --upgrade --upgrade-strategy only-if-needed "$@"
}
[ -n "${preload+-}" ] || . ~/sh/preload || exit 2
eval ${preload:-preload} has maybesudo
eval ${preload:-preload} has maybesudo confirm
[ -n "${preload+-}" ] || pippy "$@"