mirror of
https://code.forgejo.org/actions/forgejo-release.git
synced 2025-11-28 02:01:58 +02:00
fix setup_api
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
f2b08a736d
commit
ee3240803a
1 changed files with 7 additions and 5 deletions
|
|
@ -167,22 +167,24 @@ upload() {
|
|||
setup_api() {
|
||||
needed="jq curl"
|
||||
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
|
||||
|
||||
[ "$#" -eq 0 ] && return
|
||||
|
||||
# debian/ubuntu
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
apt-get -qq update
|
||||
apt-get install -y -qq "$missing"
|
||||
apt-get install -y -qq "$@"
|
||||
# arch
|
||||
elif command -v pacman >/dev/null 2>&1; then
|
||||
pacman -Syu --noconfirm "$missing"
|
||||
pacman -Syu --noconfirm "$@"
|
||||
# alpine
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
apk add --no-cache "$missing"
|
||||
apk add --no-cache "$@"
|
||||
# gentoo
|
||||
elif command -v emerge >/dev/null 2>&1; then
|
||||
emerge -q "$missing"
|
||||
emerge -q "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue