|
|
|
@ -43,30 +43,25 @@ SOURCE_STR="[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\" # This loads NV
@@ -43,30 +43,25 @@ SOURCE_STR="[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\" # This loads NV
|
|
|
|
|
|
|
|
|
|
if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then |
|
|
|
|
if [ -z $PROFILE ]; then |
|
|
|
|
echo "=> Profile not found. Tried $HOME/.bash_profile and $HOME/.profile" |
|
|
|
|
echo "=> Profile not found. Tried ~/.bash_profile ~/.zshrc and ~/.profile." |
|
|
|
|
echo "=> Create one of them and run this script again" |
|
|
|
|
else |
|
|
|
|
echo "=> Profile $PROFILE not found" |
|
|
|
|
echo "=> Profile $PROFILE not found" |
|
|
|
|
echo "=> Create it (touch $PROFILE) and run this script again" |
|
|
|
|
fi |
|
|
|
|
echo "=> Run this script again after running the following:" |
|
|
|
|
echo " OR" |
|
|
|
|
echo "=> Append the following line to the correct file yourself:" |
|
|
|
|
echo |
|
|
|
|
echo "\ttouch $HOME/.profile" |
|
|
|
|
echo " $SOURCE_STR" |
|
|
|
|
echo |
|
|
|
|
echo "-- OR --" |
|
|
|
|
echo |
|
|
|
|
echo "=> Append the following line to the correct file yourself" |
|
|
|
|
echo |
|
|
|
|
echo "\t$SOURCE_STR" |
|
|
|
|
echo |
|
|
|
|
echo "=> Close and reopen your terminal afterwards to start using NVM" |
|
|
|
|
exit |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if ! grep -qc 'nvm.sh' $PROFILE; then |
|
|
|
|
echo "=> Appending source string to $PROFILE" |
|
|
|
|
echo "" >> "$PROFILE" |
|
|
|
|
echo $SOURCE_STR >> "$PROFILE" |
|
|
|
|
else |
|
|
|
|
echo "=> Source string already in $PROFILE" |
|
|
|
|
if ! grep -qc 'nvm.sh' $PROFILE; then |
|
|
|
|
echo "=> Appending source string to $PROFILE" |
|
|
|
|
echo "" >> "$PROFILE" |
|
|
|
|
echo $SOURCE_STR >> "$PROFILE" |
|
|
|
|
else |
|
|
|
|
echo "=> Source string already in $PROFILE" |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
echo "=> Close and reopen your terminal to start using NVM" |
|
|
|
|