From 38143cd5ec0749cd65eb343568878188ab584a2f Mon Sep 17 00:00:00 2001 From: Will Owens Date: Thu, 23 Jun 2022 15:01:58 -0400 Subject: [PATCH] Switch to output parse of `--version` to determine ls flavor --- lib/git/shell_shortcuts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git/shell_shortcuts.sh b/lib/git/shell_shortcuts.sh index 5f09b8a..a508823 100644 --- a/lib/git/shell_shortcuts.sh +++ b/lib/git/shell_shortcuts.sh @@ -97,7 +97,7 @@ fi if [ "$shell_ls_aliases_enabled" = "true" ] && builtin command -v ruby > /dev/null 2>&1; then # BSD ls is different to Linux (GNU) ls # Test for BSD ls - if ! ls --color=auto > /dev/null 2>&1; then + if ! (ls --version 2>/dev/null || echo "BSD") | grep GNU >/dev/null 2>&1; then # ls is BSD _ls_bsd="BSD" fi