FIX: SUDO: parameter not set

SUDO may not be set, if no parameter or environment variable is passed. This ensures that elevate_priv gets an empty string (as expected) in those cases
This commit is contained in:
aarondill 2023-07-05 13:53:45 -05:00
parent 7d1454e430
commit 68b22402c9
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ main() {
_sudo=""
else
log "Escalated permissions are required to install man pages to ${_man_dir}"
elevate_priv "${_sudo:-$SUDO}" # use previously found command OR user defined
elevate_priv "${_sudo:-${SUDO:-}}" # use previously found command OR user defined
_sudo=${RETVAL}
log "Installing zoxide man pages as root using $_sudo, please wait…"
fi