-
- # windoze sometimes needs a special home variable setup.
- if [ "$OS" == "Windows_NT" ]; then
- # give them a default place if they don't have one already.
- if [ -z "$HOME" ]; then
- export HOME=c:/home
- fi
- # patch home to undo cygwin style of drive letter.
- # export HOME=$(echo $HOME | sed -e 's/\/cygdrive\//\//g')
- # make the home folder if it doesn't exist yet.
- if [ ! -d $HOME ]; then
- mkdir $HOME
- fi
- if [ ! -z "$SHELL_DEBUG" ]; then echo HOME is now $HOME; fi
+
+ # guess the current platform.
+ IS_UNIX=$(uname | grep -i linux)
+ if [ -z "$IS_UNIX" ]; then IS_UNIX=$(uname | grep -i unix); fi
+ if [ -z "$IS_UNIX" ]; then IS_UNIX=$(uname | grep -i darwin); fi
+ IS_DOS=$(uname | grep -i ming)
+ if [ -z "$IS_DOS" ]; then IS_DOS=$(uname | grep -i cygwin); fi
+
+ # now if we're stuck in DOS, try to determine the type of system.
+ if [ ! -z "$IS_DOS" ]; then
+ # IS_MSYS will be non-empty if this is the msys toolset. otherwise
+ # we assume that it's cygwin.
+ IS_MSYS=$(uname | grep -i ming)