From e7a762bdfef7e7810494c372c2ae6113f1f23e4b Mon Sep 17 00:00:00 2001 From: David Macek Date: Thu, 7 Jan 2016 08:29:47 +0100 Subject: [PATCH] git-extra: Rewrite part of bash_profile.sh for readability The bash_profile.sh contained several echo statements redirecting output to the newly created ~/.bash_profile. This was rewritten to use heredoc syntax. Signed-off-by: David Macek --- git-extra/bash_profile.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/git-extra/bash_profile.sh b/git-extra/bash_profile.sh index 7051ddb165..321d1b83fe 100755 --- a/git-extra/bash_profile.sh +++ b/git-extra/bash_profile.sh @@ -3,7 +3,9 @@ if [ -e ~/.bashrc -a ! -e ~/.bash_profile -a ! -e ~/.bash_login -a ! -e ~/.profi printf "\n\033[31mWARNING: Found ~/.bashrc but no ~/.bash_profile, ~/.bash_login or ~/.profile.\033[m\n\n" echo "This looks like an incorrect setup." echo "A ~/.bash_profile containing \"if [ -f ~/.bashrc ]; then . ~/.bashrc; fi\" will be created for you." - echo "# generated by Git for Windows" > ~/.bash_profile - echo "if [ -f ~/.profile ]; then . ~/.profile; fi" >> ~/.bash_profile - echo "if [ -f ~/.bashrc ]; then . ~/.bashrc; fi" >> ~/.bash_profile + cat >~/.bash_profile <<\EOF +# generated by Git for Windows +test -f ~/.profile && . ~/.profile +test -f ~/.bashrc && . ~/.bashrc +EOF fi