Skip to content

Commit e2b9650

Browse files
committed
ch "sudo" availability check to POSIX
1 parent 8dbed04 commit e2b9650

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/install-nix-from-closure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ installNix() {
378378
if sh -c "$cmd" > /dev/null 2>&1 ; then
379379
print "Creating $dest directory by running $cmd using $USER rights"
380380
else
381-
if which sudo > /dev/null 2>&1 || type sudo > /dev/null 2>&1 ; then
381+
if command -v sudo > /dev/null 2>&1 ; then
382382
print "Creating $dest directory by running $cmd using sudo:"
383383
if sudo -n true 2> /dev/null ; then
384384
print "Checked: sudo access does not require password."

0 commit comments

Comments
 (0)