From 8541e2e1ee9c77d3ed1fec7402c959e4cd9e1c9e Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 7 Oct 2015 13:57:13 -0700 Subject: [PATCH] Properly quote some possible variables with spaces. --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 1877749..2064640 100755 --- a/nvm.sh +++ b/nvm.sh @@ -78,7 +78,7 @@ if [ -z "$NVM_DIR" ]; then if [ -n "$BASH_SOURCE" ]; then NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}" fi - export NVM_DIR=$(cd $NVM_CD_FLAGS $(dirname "${NVM_SCRIPT_SOURCE:-$0}") > /dev/null && \pwd) + export NVM_DIR="$(cd $NVM_CD_FLAGS $(dirname "${NVM_SCRIPT_SOURCE:-$0}") > /dev/null && \pwd)" fi unset NVM_SCRIPT_SOURCE 2> /dev/null @@ -221,7 +221,7 @@ nvm_ensure_version_installed() { # Expand a version using the version cache nvm_version() { local PATTERN - PATTERN=$1 + PATTERN="$1" local VERSION # The default version is the current one if [ -z "$PATTERN" ]; then