From 0d208b29d0709dd4cbecf72d9116102e152f58e0 Mon Sep 17 00:00:00 2001 From: gwbeip Date: Wed, 27 May 2026 16:21:59 +0800 Subject: [PATCH] fix(Bash): helix alias --- bash/aliases/helix_alias.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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