From 57d62762e12760f66d9b3c9f1c8c6a9cbbba7736 Mon Sep 17 00:00:00 2001 From: Isaac Wolkerstorfer Date: Tue, 25 Jan 2011 17:29:49 +0100 Subject: [PATCH] Don't overwrite existing NVM_DIR vars --- nvm.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index ac7073d..59d78fc 100644 --- a/nvm.sh +++ b/nvm.sh @@ -6,7 +6,9 @@ # 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]}) +if [ ! -d "$NVM_DIR" ]; then + export NVM_DIR=$(dirname ${BASH_ARGV[0]}) +fi # Emulate curl with wget, if necessary if [ ! `which curl` ]; then