Skip to content
Myr

[Robustness] use backslash when sourcing in case of overridden dot

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes #1278.

authored by Qiangjun Ran · committed by Jordan Harband · parent 942e9ab · Browse files · 2 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:install.sh+1 added-1 removed
295 unmodified lines
296 NVM_PROFILE="$(nvm_detect_profile)"297 local INSTALL_DIR298 INSTALL_DIR="$(nvm_install_dir)"299300 SOURCE_STR="\nexport NVM_DIR=\"$INSTALL_DIR\"\n[ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\" # This loads nvm\n"300 SOURCE_STR="\nexport NVM_DIR=\"$INSTALL_DIR\"\n[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" # This loads nvm\n"301302 if [ -z "${NVM_PROFILE-}" ] ; then303 echo "=> Profile not found. Tried ${NVM_PROFILE} (as defined in \$PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile."304 echo "=> Create one of them and run this script again"
41 unmodified lines
modified:README.markdown+2 added-2 removed
72 unmodified lines
73<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).</sub>7475```sh76export NVM_DIR="$HOME/.nvm"77[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm77[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm78```7980You can customize the install source, directory, profile, and version using the `NVM_SOURCE`, `NVM_DIR`, `PROFILE`, and `NODE_VERSION` variables.81Eg: `curl ... | NVM_DIR=/usr/local/nvm bash` for a global install.
41 unmodified lines
123(you may have to add to more than one of the above files)124125```sh126export NVM_DIR="$HOME/.nvm"127[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm127[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm128```129130### Manual upgrade131
341 unmodified lines