aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-25 12:39:47 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-25 13:21:48 +1300
commit023afa3d93036e7eca9774f7e68690d397c5e44d (patch)
tree82f79f85c6d5a142c8e7d3ef783d04c7ff8d3ef7 /sh
parentMerge branch 'master' into port/bsd/freebsd (diff)
downloaddotfiles-023afa3d93036e7eca9774f7e68690d397c5e44d.tar.gz
dotfiles-023afa3d93036e7eca9774f7e68690d397c5e44d.zip
Add FreeBSD -G to ls() wrapper
Not sure this is the correct approach yet. I'm not sure I like the CLICOLOR environment variable.
Diffstat (limited to 'sh')
-rw-r--r--sh/shrc.d/ls.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh
index 58263e96..c7703663 100644
--- a/sh/shrc.d/ls.sh
+++ b/sh/shrc.d/ls.sh
@@ -31,6 +31,12 @@ ls() {
[ -e "$HOME"/.cache/ls/time-style ] &&
set -- --time-style='+%Y-%m-%d %H:%M:%S' "$@"
+ # Add -G for colorized output if the operating system is FreeBSD
+ # We have to check because -G means something else to e.g. GNU ls(1)
+ case $OS in
+ FreeBSD) set -- -G "$@" ;;
+ esac
+
# Run ls(1) with the concluded arguments
command ls "$@"
}