Skip to content

Commit

Permalink
apk_install: Check sudo first
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Oct 6, 2023
1 parent 739d450 commit bb83b2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
Expand Down

0 comments on commit bb83b2c

Please sign in to comment.