1
0
Fork 0
mirror of https://github.com/hcartiaux/dotfiles.git synced 2024-10-18 09:15:24 +02:00

[bash] ls parameter --group-directories-first does not exist on *BSD

This commit is contained in:
Hyacinthe Cartiaux 2023-02-09 23:03:02 +01:00
parent 1013ca7dcf
commit 9ebd2172ad

View file

@ -7,17 +7,17 @@
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# we always pass these to ls(1) # we always pass these to ls(1)
LS_COMMON="-F --group-directories-first -h" LS_COMMON="-F -h"
if [ "$UNAME" = Darwin ]; then if [ "$UNAME" = Darwin ]; then
# check if you're using gnu core-utils then use --color # check if you're using gnu core-utils then use --color
if [[ "$(which ls)" == "/opt/local/bin/ls" ]]; then if [[ "$(which ls)" == "/opt/local/bin/ls" ]]; then
LS_COMMON="$LS_COMMON --color" LS_COMMON="$LS_COMMON --group-directories-first --color"
else else
LS_COMMON="$LS_COMMON -G" LS_COMMON="$LS_COMMON -G"
fi fi
elif [ "$UNAME" = Linux ]; then elif [ "$UNAME" = Linux ]; then
LS_COMMON="$LS_COMMON --color" LS_COMMON="$LS_COMMON --group-directories-first --color"
fi fi
# setup the main ls alias if we've established common args # setup the main ls alias if we've established common args