mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2025-11-28 02:01:58 +02:00
posix-compliant setup_api + more distros
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
3dd816beaa
commit
b79fc25443
1 changed files with 18 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue