From 3b4ee50084036ef1567dc89c4cf70550ed6ff064 Mon Sep 17 00:00:00 2001 From: fsoppelsa Date: Fri, 5 Jul 2013 14:56:49 +0200 Subject: [PATCH] Root --- install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 1da5a5f..42be28e 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,10 @@ #!/bin/bash -NVM_DIR="$HOME/.nvm" +if [ `whoami` == 'root' ]; then + NVM_DIR="/usr/local/nvm" +else + NVM_DIR="$HOME/.nvm" +fi if [ -d "$NVM_DIR" ]; then 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 # 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" else if [ -f "$HOME/.bash_profile" ]; then