From 6e02b944f7a42a393048fd188f9ec0e26fec93d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 26 Oct 2015 15:53:20 +0100 Subject: [PATCH] Use `$BASH_SOURCE` instead of `$0` BASH_SOURCE might be more reliable. --- libexec/rbenv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rbenv b/libexec/rbenv index de7ea692..7be3eed7 100755 --- a/libexec/rbenv +++ b/libexec/rbenv @@ -12,7 +12,7 @@ if [ -n "$RBENV_DEBUG" ]; then set -x fi -if enable -f "${0%/*}"/../libexec/rbenv-realpath.dylib realpath 2>/dev/null; then +if enable -f "${BASH_SOURCE%/*}"/../libexec/rbenv-realpath.dylib realpath 2>/dev/null; then abs_dirname() { local path="$(realpath "$1")" echo "${path%/*}"