fix setup_api

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2025-11-21 11:40:24 -05:00
parent f2b08a736d
commit ee3240803a
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6

View file

@ -167,22 +167,24 @@ upload() {
setup_api() { setup_api() {
needed="jq curl" needed="jq curl"
for cmd in $needed; do for cmd in $needed; do
command -v "$cmd" >/dev/null 2>&1 || missing="$missing $cmd" command -v "$cmd" >/dev/null 2>&1 || set -- "$@" "$cmd"
done done
[ "$#" -eq 0 ] && return
# debian/ubuntu # debian/ubuntu
if command -v apt-get >/dev/null 2>&1; then if command -v apt-get >/dev/null 2>&1; then
apt-get -qq update apt-get -qq update
apt-get install -y -qq "$missing" apt-get install -y -qq "$@"
# arch # arch
elif command -v pacman >/dev/null 2>&1; then elif command -v pacman >/dev/null 2>&1; then
pacman -Syu --noconfirm "$missing" pacman -Syu --noconfirm "$@"
# alpine # alpine
elif command -v apk >/dev/null 2>&1; then elif command -v apk >/dev/null 2>&1; then
apk add --no-cache "$missing" apk add --no-cache "$@"
# gentoo # gentoo
elif command -v emerge >/dev/null 2>&1; then elif command -v emerge >/dev/null 2>&1; then
emerge -q "$missing" emerge -q "$@"
fi fi
} }