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

20 lines
716 B
Text
Raw Normal View History

#!/usr/bin/env sh
# compat: +ash +bash +dash +zsh
2021-07-29 00:37:35 -07:00
pippy() { ### @-
2021-08-01 09:27:25 -07:00
### install Python packages using pip,
### but only update their dependencies as required.
### this uses [`maybesudo`](#maybesudo) 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
maybesudo python3 -m pip install --upgrade --upgrade-strategy only-if-needed "$@"
2021-07-29 00:37:35 -07:00
}
2021-09-23 06:48:05 -07:00
[ -n "${preload+-}" ] || . ~/sh/preload || exit 2
eval ${preload:-preload} has maybesudo confirm
[ -n "${preload+-}" ] || pippy "$@"