mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-12 15:11:50 +00:00
Merge 631563db9c
into 7c45d62b37
This commit is contained in:
commit
a1ed6eef69
@ -116,6 +116,12 @@ To activate, you need to source `bash_completion`:
|
|||||||
|
|
||||||
Put the above sourcing line just below the sourcing line for NVM in your profile (`.bashrc`, `.bash_profile`).
|
Put the above sourcing line just below the sourcing line for NVM in your profile (`.bashrc`, `.bash_profile`).
|
||||||
|
|
||||||
|
## System-wide Installation
|
||||||
|
|
||||||
|
To install nvm for all users, define the environment variable `NVM_DIR` for the install script:
|
||||||
|
|
||||||
|
curl https://raw.github.com/creationix/nvm/v0.3.0/install.sh | NVM_DIR=/usr/local/nvm sh
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
nvm
|
nvm
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
NVM_DIR="$HOME/.nvm"
|
if [ -z "$NVM_DIR" ]
|
||||||
|
then
|
||||||
|
NVM_DIR="$HOME/.nvm"
|
||||||
|
fi
|
||||||
|
|
||||||
if ! hash git 2>/dev/null; then
|
if ! hash git 2>/dev/null; then
|
||||||
echo >&2 "You need to install git - visit http://git-scm.com/downloads"
|
echo >&2 "You need to install git - visit http://git-scm.com/downloads"
|
||||||
@ -32,7 +35,7 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SOURCE_STR="[[ -s \$HOME/.nvm/nvm.sh ]] && . \$HOME/.nvm/nvm.sh # This loads NVM"
|
SOURCE_STR="[[ -s $NVM_DIR/nvm.sh ]] && . $NVM_DIR/nvm.sh # This loads NVM"
|
||||||
|
|
||||||
if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then
|
if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then
|
||||||
if [ -z $PROFILE ]; then
|
if [ -z $PROFILE ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user