fix error due to using wrong command name for `has_cmd` function

This commit is contained in:
aarondill 2023-07-05 13:23:57 -05:00
parent aaa1418519
commit ebebf77cc8
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ elevate_priv() {
fi fi
fi fi
if has sudo; then if has_cmd sudo; then
if sudo true; then if sudo true; then
printf 'sudo' printf 'sudo'
return 0 return 0
@ -44,7 +44,7 @@ elevate_priv() {
fi fi
fi fi
if has doas; then if has_cmd doas; then
if doas true; then if doas true; then
printf "doas" printf "doas"
return 0 return 0
@ -112,7 +112,7 @@ main() {
else else
log "Escalated permissions are required to install to ${_bin_dir}" log "Escalated permissions are required to install to ${_bin_dir}"
_sudo=$(elevate_priv "$_sudo") _sudo=$(elevate_priv "$_sudo")
log "Installing zoxide as root, please wait…" log "Installing zoxide as root using $_sudo, please wait…"
fi fi
# Create and enter a temporary directory. # Create and enter a temporary directory.