From 7e7630e62473cf9e9c63e6d6b1d2307990d50cdd Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 25 Sep 2007 21:42:54 +0100 Subject: [PATCH] Warn about the /cmd path only when necessary If /cmd is already in the PATH, no need to show the message. While at it, check for a message-of-the-day, and display it if there is one. Signed-off-by: Johannes Schindelin --- etc/motd | 5 +++++ etc/profile | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 etc/motd diff --git a/etc/motd b/etc/motd new file mode 100644 index 0000000000..aa1f6487a1 --- /dev/null +++ b/etc/motd @@ -0,0 +1,5 @@ +Welcome to msysGit +------------------ + +Have fun! + diff --git a/etc/profile b/etc/profile index 457fe9a57e..9b22cf843f 100644 --- a/etc/profile +++ b/etc/profile @@ -72,7 +72,7 @@ elif [ -e /etc/bash_profile ]; then fi # Git specific stuff -test -e /bin/git.exe || test -e /git/git.exe || { +test -e /bin/git.exe -o -e /git/git.exe || { echo echo ------------------------------------------------------- echo "Building and Installing Git" @@ -101,15 +101,24 @@ This is a minimal MSYS environment to work on Git. $MESSAGE +EOF +} + +test -f /etc/motd && sed "s/\$MESSAGE/$MESSAGE/" < /etc/motd + +case "$PATH" in +*"$(cd / && pwd -W)\\cmd:"*) ;; +*) + cat << EOF + In order to use Git from cmd.exe: 1. Add c:\msysgit\cmd to cmd's PATH 2. DON'T add c:\msysgit\bin or c:\msysgit\mingw\bin to cmd's PATH Commands like 'git add' will work from cmd.exe now. Commands like 'git-add' will NOT work. Add more wrappers as appropriate. - -Have fun! EOF -} +esac + . /git/contrib/completion/git-completion.bash -- 2.11.4.GIT