Skip to content

Commit

Permalink
install.sh: Add support to use doas instead of sudo, if doas is found
Browse files Browse the repository at this point in the history
Signed-off-by: kernaltrap <[email protected]>
  • Loading branch information
kernaltrap8 committed Jul 21, 2024
1 parent 270a5a7 commit 741cc4c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ function ask_confirmation {
done
}

# Check if we have doas, if we do, use it instead of sudo.
if [[ -n "$(command -v doas)" ]]; then
SUDO=doas
else
SUDO=sudo
fi

# Usually we use sudo, but if prefix is somewhere in ~/, we don't need sudo
SUDO=sudo
if [ -w "$PREFIX" ] || ! which sudo > /dev/null; then
SUDO=
fi
Expand Down

0 comments on commit 741cc4c

Please sign in to comment.