diff --git a/forgit.plugin.zsh b/forgit.plugin.zsh index 10e9828..4c81c7d 100755 --- a/forgit.plugin.zsh +++ b/forgit.plugin.zsh @@ -5,7 +5,11 @@ forgit::warn() { printf "%b[Warn]%b %s\n" '\e[0;33m' '\e[0m' "$@" >&2; } # set installation path if [[ -n "$ZSH_VERSION" ]]; then - FORGIT_INSTALL_DIR="$( dirname -- "$0")" + # shellcheck disable=2277,2296,2299 + 0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}" + # shellcheck disable=2277,2296,2298 + 0="${${(M)0:#/*}:-$PWD/$0}" + FORGIT_INSTALL_DIR="${0:h}" elif [[ -n "$BASH_VERSION" ]]; then FORGIT_INSTALL_DIR="$(dirname -- "${BASH_SOURCE[0]}")" else