Permalink
Browse files

Check for coreutils, not OS, for aliases

  • Loading branch information...
1 parent df8bef7 commit d3072407806fe1bdf86cf34c7e7a60b8dccc25d9 @bhuga committed Feb 1, 2013
Showing with 6 additions and 3 deletions.
  1. +1 −0 bash_dotfiles/002-coreutils.sh
  2. +5 −3 bash_dotfiles/shell.sh
@@ -0,0 +1 @@
+PATH="/opt/boxen/homebrew/opt/coreutils/libexec/gnubin:$PATH"
View
@@ -5,10 +5,12 @@ if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
-if [ $OS == 'Darwin' ]; then
- alias ls='ls -alhG'
-elif [ $OS == 'Linux' ]; then
+# test for gnu coreutils.
+ls --help | grep -q GNU
+if [ $? == 0 ]; then
alias ls='ls -ah --color=auto'
+else
+ alias ls='ls -alhG'
fi
# it so happens that i LIKE the ubuntu prompt, even on OS X.

0 comments on commit d307240

Please sign in to comment.