From 7211c9ee2956b848951fe7036bc73d562717741d Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Sun, 22 Dec 2013 18:05:20 +0100 Subject: [PATCH] updated output without special characters (tab; \t) Omit duplicate 'finish line' normalized indentation --- install-gitless.sh | 25 +++++++++++++------------ install.sh | 33 ++++++++++++++------------------- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/install-gitless.sh b/install-gitless.sh index a2bd9cc..c24d25b 100755 --- a/install-gitless.sh +++ b/install-gitless.sh @@ -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" diff --git a/install.sh b/install.sh index dee3a0f..2804803 100755 --- a/install.sh +++ b/install.sh @@ -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"