Enable the command line prompt from the completions by default
[msysgit.git] / etc / profile
blobfc6eee8d47db33b2f393b048789bad262321371f
1 # Copyright (C) 2001, 2002  Earnie Boyd  <earnie@users.sf.net>
2 # This file is part of the Minimal SYStem.
3 #   http://www.mingw.org/msys.shtml
5 #         File: profile
6 #  Description: Shell environment initialization script
7 # Last Revised: 2002.05.04
9 if [ -z "$MSYSTEM" ]; then
10   MSYSTEM=MINGW32
13 # My decision to add a . to the PATH and as the first item in the path list
14 # is to mimick the Win32 method of finding executables.
16 # I filter the PATH value setting in order to get ready for self hosting the
17 # MSYS runtime and wanting different paths searched first for files.
18 if [ $MSYSTEM == MINGW32 ]; then
19   export PATH=".:/usr/local/bin:/mingw/bin:/bin:$PATH"
20 else
21   export PATH=".:/usr/local/bin:/bin:/mingw/bin:$PATH"
24 if [ -z "$USERNAME" ]; then
25   LOGNAME="`id -un`"
26 else
27   LOGNAME="$USERNAME"
30 # Set up USER's home directory
31 if [ -z "$HOME" ]; then
32   HOME="$USERPROFILE"
35 if [ ! -d "$HOME" ]; then
36         echo "Error: HOME directory '$HOME' doen't exist!"
37         echo "Please fix this error and restart shell."
38         echo "Press key to quit."
39         read dummy
40         exit 1
43 # normalize HOME to unix path
44 HOME="$(cd "$HOME" ; pwd)"
46 export PATH="$HOME/bin:$PATH"
48 export GNUPGHOME=~/.gnupg
50 if [ "x$HISTFILE" == "x/.bash_history" ]; then
51   HISTFILE=$HOME/.bash_history
54 if [ -e ~/.inputrc ]; then
55     export INPUTRC=~/.inputrc
56 else
57     export INPUTRC=/etc/inputrc
60 export HOME LOGNAME MSYSTEM HISTFILE
62 for i in /etc/profile.d/*.sh ; do
63   if [ -f $i ]; then
64     . $i
65   fi
66 done
68 export MAKE_MODE=unix
69 export PS1='\[\033]0;$MSYSTEM:\w\007
70 \033[32m\]\u@\h \[\033[33m\w\033[0m\]
71 $ '
73 if [ -e ~/.bashrc ]; then
74     . ~/.bashrc
75 elif [ -e ~/.bash_profile ]; then
76     . ~/.bash_profile
77 elif [ -e /etc/bash_profile ]; then
78     . /etc/bash_profile
81 # Git specific stuff
82 test -e /bin/git.exe -o -e /git/git.exe || {
83         echo
84         echo -------------------------------------------------------
85         echo "Building and Installing Git"
86         echo -------------------------------------------------------
88         cd /git &&
89         make install
91         case $? in
92         0)
93                 MESSAGE="You are in the git working tree, and all is ready for you to hack."
94         ;;
95         *)
96                 MESSAGE="Your build failed...  Please fix it, and give feedback on the Git list."
97         esac
99         test -d /installer-tmp && rm -rf /installer-tmp
101         cat <<EOF
104 -------------------------
105 Hello, dear Git developer.
107 This is a minimal MSYS environment to work on Git.
109 $MESSAGE
113 cd "$HOME"
115 test -f /etc/motd && sed "s/\$MESSAGE/$MESSAGE/" < /etc/motd
117 case ":$PATH:" in
118 *:/cmd:*|*:/bin:*) ;;
120         cat << EOF
122 In order to use Git from cmd.exe:
123 1. Add c:\msysgit\cmd to cmd's PATH
124 2. DON'T add c:\msysgit\bin or c:\msysgit\mingw\bin to cmd's PATH
125 Commands like 'git add' will work from cmd.exe now.
126 Commands like 'git-add' will NOT work. Add more wrappers as appropriate.
128 esac
131 . /git/contrib/completion/git-completion.bash
132 PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
134 export LESS=-FRSX