This commit is contained in:
fsoppelsa 2013-07-05 14:56:49 +02:00
parent 7fb6d1ec6a
commit 3b4ee50084
1 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,10 @@
#!/bin/bash #!/bin/bash
if [ `whoami` == 'root' ]; then
NVM_DIR="/usr/local/nvm"
else
NVM_DIR="$HOME/.nvm" NVM_DIR="$HOME/.nvm"
fi
if [ -d "$NVM_DIR" ]; then if [ -d "$NVM_DIR" ]; then
echo "=> NVM is already installed in $NVM_DIR, trying to update" echo "=> NVM is already installed in $NVM_DIR, trying to update"
@ -15,7 +19,9 @@ git clone https://github.com/creationix/nvm.git $NVM_DIR
echo echo
# Detect profile file, .bash_profile has precedence over .profile # Detect profile file, .bash_profile has precedence over .profile
if [ ! -z "$1" ]; then if [ `whoami` == 'root' ]; then
PROFILE="/etc/bash.bashrc
elsif [ ! -z "$1" ]; then
PROFILE="$1" PROFILE="$1"
else else
if [ -f "$HOME/.bash_profile" ]; then if [ -f "$HOME/.bash_profile" ]; then