Skip to content

Commit

Permalink
Use $OSTYPE instead of $MACHTYPE
Browse files Browse the repository at this point in the history
`$OSTYPE` is a better descriptor of the operating system. Let's not abuse
the content of `$MACHTYPE` that is meant to describe the architecture.
  • Loading branch information
gioele committed Aug 11, 2012
1 parent 8c1f120 commit 4f282ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bashrc_dispatch
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ BASHRC_DISPATCH_PID=$$


SHELL_PLATFORM='OTHER'
case "$MACHTYPE" in
case "$OSTYPE" in
*'linux'* ) SHELL_PLATFORM='LINUX' ;;
*'darwin'* ) SHELL_PLATFORM='OSX' ;;
*'freebsd'* ) SHELL_PLATFORM='BSD' ;;
esac

if ! type -p shell_is_login ; then
shell_is_linux () { [[ "$MACHTYPE" == *'linux'* ]] ; }
shell_is_osx () { [[ "$MACHTYPE" == *'darwin'* ]] ; }
shell_is_linux () { [[ "$OSTYPE" == *'linux'* ]] ; }
shell_is_osx () { [[ "$OSTYPE" == *'darwin'* ]] ; }
shell_is_login () { shopt -q login_shell ; }
shell_is_interactive () { test -n "$PS1" ; }
shell_is_script () { ! shell_is_interactive ; }
Expand Down

0 comments on commit 4f282ac

Please sign in to comment.