diff --git a/bash/aliases/helix_alias.sh b/bash/aliases/helix_alias.sh index ae50c30..7b702e9 100644 --- a/bash/aliases/helix_alias.sh +++ b/bash/aliases/helix_alias.sh @@ -1,10 +1,16 @@ #!/usr/bin/env bash pj_helix() { - if command -v helix >/dev/null 2>&1; then - command helix -c "$BASH_POLYJUICE_HELIX_CONFIG_FILE" "$@" - elif command -v hx >/dev/null 2>&1; then - command hx -c "$BASH_POLYJUICE_HELIX_CONFIG_FILE" "$@" + local helix_bin + local hx_bin + + helix_bin=$(type -P helix) + hx_bin=$(type -P hx) + + if [[ -n "$helix_bin" ]]; then + command "$helix_bin" -c "$BASH_POLYJUICE_HELIX_CONFIG_FILE" "$@" + elif [[ -n "$hx_bin" ]]; then + command "$hx_bin" -c "$BASH_POLYJUICE_HELIX_CONFIG_FILE" "$@" else echo "HELIX/HX is not installed" return 1