Merge pull request #198 from ArtemGordinsky/master

Adding a newline before the source string in the ".bash_profile"
master
Tim Caswell 2013-05-09 06:39:01 -07:00
commit eade411422
2 changed files with 6 additions and 3 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ alias
# For testing # For testing
bak bak
.urchin.log .urchin.log
.DS_Store

View File

@ -12,7 +12,7 @@ fi
# Cloning to $NVM_TARGET # Cloning to $NVM_TARGET
git clone git://github.com/creationix/nvm.git $NVM_TARGET git clone git://github.com/creationix/nvm.git $NVM_TARGET
echo echo
# Detect profile file, .bash_profile has precedence over .profile # Detect profile file, .bash_profile has precedence over .profile
if [ ! -z "$1" ]; then if [ ! -z "$1" ]; then
@ -28,7 +28,7 @@ fi
SOURCE_STR="[[ -s "$NVM_TARGET/nvm.sh" ]] && . "$NVM_TARGET/nvm.sh" # This loads NVM" SOURCE_STR="[[ -s "$NVM_TARGET/nvm.sh" ]] && . "$NVM_TARGET/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
echo "=> Profile not found" echo "=> Profile not found"
else else
echo "=> Profile $PROFILE not found" echo "=> Profile $PROFILE not found"
@ -36,13 +36,14 @@ if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then
echo "=> Append the following line to the correct file yourself" echo "=> Append the following line to the correct file yourself"
echo echo
echo -e "\t$SOURCE_STR" echo -e "\t$SOURCE_STR"
echo echo
echo "=> Close and reopen your terminal to start using NVM" echo "=> Close and reopen your terminal to start using NVM"
exit exit
fi fi
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 -e "\n" >> "$PROFILE"
echo $SOURCE_STR >> "$PROFILE" echo $SOURCE_STR >> "$PROFILE"
else else
echo "=> Source string already in $PROFILE" echo "=> Source string already in $PROFILE"