fix: file_preview mac系统下ls错误
This commit is contained in:
parent
44e9d4f11b
commit
d136130771
|
|
@ -2,7 +2,7 @@
|
||||||
mime=$(file -bL --mime-type "$1")
|
mime=$(file -bL --mime-type "$1")
|
||||||
category=${mime%%/*}
|
category=${mime%%/*}
|
||||||
if [ -d "$1" ]; then
|
if [ -d "$1" ]; then
|
||||||
exa -l --no-user --no-time --icons "$1" 2>/dev/null || ls --color=tty "$1" || ls -G "$1"
|
exa -l --no-user --no-time --icons "$1" 2>/dev/null || ls --color=tty "$1" 2>/dev/null || ls -G "$1"
|
||||||
elif [ "$category" = text ]; then
|
elif [ "$category" = text ]; then
|
||||||
(bat -p --color=always "$1" || cat "$1") 2>/dev/null | head -100
|
(bat -p --color=always "$1" || cat "$1") 2>/dev/null | head -100
|
||||||
elif [ "$category" = image ]; then
|
elif [ "$category" = image ]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue