From 243b5baff3bc943c32bf9f6df550cbee531ee23a Mon Sep 17 00:00:00 2001 From: addhewarman Date: Mon, 7 Jul 2014 18:21:55 +0700 Subject: [PATCH] Update install.sh may be this is solution for printf, i've tested this and so far no issue --- install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index cb3d99d..bf7ec5c 100755 --- a/install.sh +++ b/install.sh @@ -101,8 +101,6 @@ if [ -z "$PROFILE" ]; then fi fi -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" ]; then echo "=> Profile not found. Tried ~/.bash_profile, ~/.zshrc, and ~/.profile." @@ -118,7 +116,12 @@ if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then else if ! grep -qc 'nvm.sh' "$PROFILE"; then echo "=> Appending source string to $PROFILE" - printf "%s" "$SOURCE_STR" >> "$PROFILE" + +cat << EOF >> "$PROFILE" +export NVM_DIR="$NVM_DIR" +[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm +EOF + else echo "=> Source string already in $PROFILE" fi