From bb83b2c3a12264aa80c0f8c8e810633adc6b4376 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 7 Oct 2023 02:17:05 +0900 Subject: [PATCH] apk_install: Check sudo first --- main.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.sh b/main.sh index b03c99af..bc172035 100755 --- a/main.sh +++ b/main.sh @@ -289,7 +289,9 @@ snap_install() { fi } apk_install() { - if type -P doas &>/dev/null; then + if type -P sudo &>/dev/null; then + sudo apk --no-cache add "$@" + elif type -P doas &>/dev/null; then doas apk --no-cache add "$@" else apk --no-cache add "$@"