posix-compliant setup_api + more distros

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2025-11-14 23:15:08 -05:00
parent 3dd816beaa
commit b79fc25443
No known key found for this signature in database
GPG key ID: 425ACD2D4830EBC6

View file

@ -42,7 +42,7 @@ get_tag() {
if api GET "repos/$REPO/tags/$TAG_URL" >"$TAG_FILE"; then
echo "tag $TAG exists"
else
echo "tag $TAG does not exists"
echo "tag $TAG does not exist"
fi
fi
test -s "$TAG_FILE"
@ -172,9 +172,24 @@ upload() {
}
setup_api() {
if ! which jq curl; then
needed="jq curl"
for cmd in $needed; do
command -v "$cmd" >/dev/null 2>&1 || missing="$missing $cmd"
done
# debian/ubuntu
if command -v apt-get >/dev/null 2>&1; then
apt-get -qq update
apt-get install -y -qq jq curl
apt-get install -y -qq "$missing"
# arch
elif command -v pacman >/dev/null 2>&1; then
pacman -Syu --noconfirm "$missing"
# alpine
elif command -v apk >/dev/null 2>&1; then
apk add --no-cache "$missing"
# gentoo
elif command -v emerge >/dev/null 2>&1; then
emerge -q "$missing"
fi
}