From 95c8e4fbac3f521c28472812e89bc8494d2e014b Mon Sep 17 00:00:00 2001 From: Marc Harter Date: Tue, 11 Jan 2011 10:53:53 -0600 Subject: [PATCH] BASH_ARGV[0] doesn't work in ZSH --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 99eb87a..fafc0bc 100644 --- a/nvm.sh +++ b/nvm.sh @@ -5,8 +5,8 @@ # Implemented by Tim Caswell # with much bash help from Matthew Ranney -# Auto detect the NVM_DIR using magic bash 3.x stuff -export NVM_DIR=$(dirname ${BASH_ARGV[0]}) +eval last=\${$#} +export NVM_DIR=$(dirname $last) nvm() {