96ea17080a7addd1cd8b6253422776bc237fc6b1

Author
Lucas Ma <396089703@qq.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(installer): tolerate sudo shims without -k (#13821)

Co-authored-by: Lucas Ma <7184042+pony-maggie@users.noreply.github.com>

Diff

 1diff --git a/tools/install.sh b/tools/install.sh
 2index d907b795ca316c2a9b34ae58d3c820dcc2d0714a..5234c17a4d5f3e3cd2162d35ec134f77ac0632da 100755
 3--- a/tools/install.sh
 4+++ b/tools/install.sh
 5@@ -473,7 +473,7 @@ EOF
 6   # be prompted for the password either way, so this shouldn't cause any issues.
 7   #
 8   if user_can_sudo; then
 9-    sudo -k >/dev/null 2>&1         # -k forces the password prompt
10+    sudo -k >/dev/null 2>&1 || true # -k forces the password prompt when supported
11     sudo chsh -s "$zsh" "$USER"
12   else
13     chsh -s "$zsh" "$USER"          # run chsh normally