updated output without special characters (tab; \t)

Omit duplicate 'finish line'
normalized indentation
master
Koen Punt 2013-12-22 18:05:20 +01:00
parent 246caa8581
commit 7211c9ee29
2 changed files with 27 additions and 31 deletions

View File

@ -46,24 +46,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"
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 "=> Create it (touch $PROFILE) and run this script again"
fi
echo "=> Append the following line to the correct file yourself"
echo " OR"
echo "=> Append the following line to the correct file yourself:"
echo
echo "\t$SOURCE_STR"
echo " $SOURCE_STR"
echo
echo "=> Close and reopen your terminal 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"

View File

@ -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"