diff --git a/nvm-exec b/nvm-exec index 44d5ddb..536d2aa 100755 --- a/nvm-exec +++ b/nvm-exec @@ -1,6 +1,8 @@ #!/usr/bin/env bash -DIR="$(command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SOURCE=${BASH_SOURCE[0]} +test -L "$SOURCE" && SOURCE=`readlink "$SOURCE"` +DIR="$(command cd "$( dirname "$SOURCE" )" && pwd )" unset NVM_CD_FLAGS diff --git a/nvm.sh b/nvm.sh index 2e4378f..7261b4b 100644 --- a/nvm.sh +++ b/nvm.sh @@ -3871,7 +3871,9 @@ nvm() { nvm_echo "Running node ${VERSION}$(nvm use --silent "${VERSION}" && nvm_print_npm_version)" fi fi - NODE_VERSION="${VERSION}" "${NVM_DIR}/nvm-exec" "$@" + NVM_EXEC="$NVM_DIR/nvm-exec" + test ! -f "$NVM_EXEC" && NVM_EXEC=`dirname ${BASH_SOURCE[0]-}`/nvm-exec + NODE_VERSION="$VERSION" "$NVM_EXEC" "$@" ;; "ls" | "list") local PATTERN