BSD fix for unsupported ls -G alias and added fallback supprt for colorls as per Issue #836

This commit is contained in:
Rob Dudley 2013-08-13 09:03:17 +01:00
commit 275ffcec95

View file

@ -6,9 +6,9 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
# Enable ls colors # Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ] if [ "$DISABLE_LS_COLORS" != "true" ]
then then
UNAME=$(uname -s)
# Find the option for using colors in ls, depending on the version: Linux or BSD # Find the option for using colors in ls, depending on the version: Linux or BSD
if [[ $UNAME =~ ".*BSD$" ]]; then if [[ $(uname -s) =~ ".*BSD$" ]]; then
print "BSD" print "BSD"
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors); # On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);