Skip to content

Commit efdd5d5

Browse files
unknowndevQwQkylecarbsbpmct
authored
feat: add doas support (#4531)
* feat: add doas support Some people may have some reason to drop sudo and switch to doas * chore: doas at the end Just because it is relatively cold :-( Co-authored-by: Kyle Carberry <kyle@carberry.com> * chore(CI): add doas to pass CI * fix syntax error Co-authored-by: Kyle Carberry <kyle@carberry.com> Co-authored-by: Ben <me@bpmct.net>
1 parent de5ba47 commit efdd5d5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ IST = "IST"
55
MacOS = "macOS"
66

77
[default.extend-words]
8+
# do as sudo replacement
9+
doas = "doas"
810

911
[files]
1012
extend-exclude = [

install.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ sh_c() {
531531
sudo_sh_c() {
532532
if [ "$(id -u)" = 0 ]; then
533533
sh_c "$@"
534+
elif command_exists doas; then
535+
sh_c "doas $*"
534536
elif command_exists sudo; then
535537
sh_c "sudo $*"
536538
elif command_exists su; then
@@ -539,7 +541,7 @@ sudo_sh_c() {
539541
echoh
540542
echoerr "This script needs to run the following command as root."
541543
echoerr " $*"
542-
echoerr "Please install sudo or su."
544+
echoerr "Please install sudo, su, or doas."
543545
exit 1
544546
fi
545547
}

0 commit comments

Comments
 (0)