From 77b7fbf2394c2a59246a1e686c8909a716b37112 Mon Sep 17 00:00:00 2001 From: Wil Moore III Date: Mon, 14 Oct 2013 01:59:00 -0600 Subject: [PATCH] refactor to ${commands[exec]:h} as mentioned in PR --- modules/utility/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index caffd2a0..ed6046b1 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -189,7 +189,7 @@ function psu { function cdx { local exe="$1" local fqe="$(command -v $exe 2>/dev/null)" - local dir="$(dirname $fqe 2>/dev/null)" + local dir="${commands[$exe]:h}" if [[ ! -x "$fqe" ]]; then echo "cdx: '$exe' not found."