Browse Source

Properly quote some possible variables with spaces.

Jordan Harband 9 years ago
parent
commit
8541e2e1ee
  1. 4
      nvm.sh

4
nvm.sh

@ -78,7 +78,7 @@ if [ -z "$NVM_DIR" ]; then
if [ -n "$BASH_SOURCE" ]; then if [ -n "$BASH_SOURCE" ]; then
NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}" NVM_SCRIPT_SOURCE="${BASH_SOURCE[0]}"
fi 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 fi
unset NVM_SCRIPT_SOURCE 2> /dev/null unset NVM_SCRIPT_SOURCE 2> /dev/null
@ -221,7 +221,7 @@ nvm_ensure_version_installed() {
# Expand a version using the version cache # Expand a version using the version cache
nvm_version() { nvm_version() {
local PATTERN local PATTERN
PATTERN=$1 PATTERN="$1"
local VERSION local VERSION
# The default version is the current one # The default version is the current one
if [ -z "$PATTERN" ]; then if [ -z "$PATTERN" ]; then

Loading…
Cancel
Save