apk_install: Check sudo first

This commit is contained in:
Taiki Endo
2023-10-07 02:17:05 +09:00
parent 739d45026e
commit bb83b2c3a1

View File

@@ -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 "$@"