export NVM_DIR before sourcing nvm.sh
parent
578a601b27
commit
16c0be8314
10
install.sh
10
install.sh
|
@ -101,7 +101,7 @@ if [ -z "$PROFILE" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SOURCE_STR="[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\" # This loads nvm"
|
SOURCE_STR="\nexport NVM_DIR=\"$NVM_DIR\"\n[ -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
|
||||||
|
@ -112,15 +112,13 @@ if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then
|
||||||
echo "=> Create it (touch $PROFILE) and run this script again"
|
echo "=> Create it (touch $PROFILE) and run this script again"
|
||||||
fi
|
fi
|
||||||
echo " OR"
|
echo " OR"
|
||||||
echo "=> Append the following line to the correct file yourself:"
|
echo "=> Append the following lines to the correct file yourself:"
|
||||||
echo
|
echo -e "$SOURCE_STR"
|
||||||
echo " $SOURCE_STR"
|
|
||||||
echo
|
echo
|
||||||
else
|
else
|
||||||
if ! grep -qc 'nvm.sh' $PROFILE; then
|
if ! grep -qc 'nvm.sh' $PROFILE; then
|
||||||
echo "=> Appending source string to $PROFILE"
|
echo "=> Appending source string to $PROFILE"
|
||||||
echo "" >> "$PROFILE"
|
echo -e "$SOURCE_STR" >> "$PROFILE"
|
||||||
echo $SOURCE_STR >> "$PROFILE"
|
|
||||||
else
|
else
|
||||||
echo "=> Source string already in $PROFILE"
|
echo "=> Source string already in $PROFILE"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue