move the "detected architecture: ..." message to *after* `parse_args`

This avoids logging the message when `--help` is specified, and helps ensure the correct output if `--arch` is specified
This commit is contained in:
aarondill 2023-07-05 12:51:22 -05:00
parent f1a54433a2
commit 213f69f408
1 changed files with 2 additions and 2 deletions

View File

@ -68,8 +68,6 @@ main() {
ensure get_architecture ensure get_architecture
local _arch="${RETVAL}" local _arch="${RETVAL}"
fi fi
assert_nz "${_arch}" "arch"
log "Detected architecture: ${_arch}"
local _bin_dir="${HOME}/.local/bin" local _bin_dir="${HOME}/.local/bin"
local _bin_name local _bin_name
@ -81,6 +79,8 @@ main() {
_man_dir=${MAN_DIR:-$_man_dir} _man_dir=${MAN_DIR:-$_man_dir}
_arch=${ARCH:-$_arch} _arch=${ARCH:-$_arch}
assert_nz "${_arch}" "arch"
log "Detected architecture: ${_arch}"
case "${_arch}" in case "${_arch}" in
*windows*) _bin_name="zoxide.exe" ;; *windows*) _bin_name="zoxide.exe" ;;
*) _bin_name="zoxide" ;; *) _bin_name="zoxide" ;;