Skip to content

Commit

Permalink
git-extra: Rewrite part of bash_profile.sh for readability
Browse files Browse the repository at this point in the history
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 <david.macek.0@gmail.com>
  • Loading branch information
elieux committed Jan 7, 2016
1 parent 5b772b7 commit e7a762b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions git-extra/bash_profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e7a762b

Please sign in to comment.