aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Moesen <github.com@moesen.nu>2012-07-23 16:43:46 +0200
committerMathias Bynens <mathias@qiwi.be>2012-07-23 16:45:15 +0200
commit1dec7d88d479c8951fc24cce1091a048b1894aa0 (patch)
treedf3f77efe58e77ce3949b9316c812b3b7a9883d9
parentcf79d2cdb811b689605ca5757508ce4a0bf2f127 (diff)
downloaddotfiles-1dec7d88d479c8951fc24cce1091a048b1894aa0.tar.gz
dotfiles-1dec7d88d479c8951fc24cce1091a048b1894aa0.tar.bz2
dotfiles-1dec7d88d479c8951fc24cce1091a048b1894aa0.zip
.aliases: Optimize the `ls` flavor detection even further
Ref. #89.
-rw-r--r--.aliases6
1 files changed, 3 insertions, 3 deletions
diff --git a/.aliases b/.aliases
index dbcafeb..52a588d 100644
--- a/.aliases
+++ b/.aliases
@@ -19,10 +19,10 @@ alias o="open"
alias oo="open ."
# Detect which `ls` flavor is in use
-if ls --color 2> /dev/null | grep -q 'invalid option'; then # OS X `ls`
- colorflag="-G"
-else # GNU `ls`
+if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
+else # OS X `ls`
+ colorflag="-G"
fi
# List all files colorized in long format