bin/b: fix exit code for uncompressed binary
This commit is contained in:
parent
620b628ba5
commit
50f3d4bef1
|
@ -16,9 +16,11 @@ test -x "$(dirname "$last")" &&
|
|||
tput setaf 4 && $elevate file -E "$last" | ( grep -v --color=never 'directory$' || true )
|
||||
|
||||
case "$($elevate file --dereference --mime "$last")" in
|
||||
*inode/directory*) tput sgr0 && $(test -x "$last" || echo "sudo") ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --all "$@" | less -XF;;
|
||||
*binary) expr "$(file "$last")" : ".*: .*compress" >/dev/null && /usr/share/nvim/runtime/macros/less.sh "$@";;
|
||||
*) $elevate bat --style header "$@" --pager 'less -RXF'
|
||||
(*inode/directory*) tput sgr0 && $(test -x "$last" || echo "sudo") ls -l --color=always --human-readable --group-directories-first --file-type --dereference-command-line --all "$@" | less -XF;;
|
||||
(*binary) if expr "$(file "$last")" : ".*: .*compress" >/dev/null
|
||||
then /usr/share/nvim/runtime/macros/less.sh "$@"
|
||||
fi;;
|
||||
(*) $elevate bat --style header "$@" --pager 'less -RXF'
|
||||
tput setaf 3 && $elevate stat --format '%A size %sB, birth: %.10w mod %.10y' "$last"
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue