From 7985f33b53a98612938be5d2a3723271b860e2fa Mon Sep 17 00:00:00 2001 From: xerus2000 <27jf@pm.me> Date: Fri, 13 Nov 2020 13:33:01 +0100 Subject: [PATCH] bin: update b function to use mime type --- .local/bin/b | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.local/bin/b b/.local/bin/b index 3d174fb..4699c3c 100755 --- a/.local/bin/b +++ b/.local/bin/b @@ -10,8 +10,9 @@ #else arg=$(test $# -gt 0 && echo "${@:-1}" || echo .) file $arg | grep -v --color=never directory - case "$(file --dereference $arg)" in + case "$(file --dereference --mime $arg)" in *directory) ls -l --color=auto --almost-all --human-readable --group-directories-first --file-type --dereference-command-line "$@";; - *text*|*JSON*) bat --style header "$@";; + *binary*) ;; + *) bat --style header "$@";; esac #fi