From 453ca94e18eb8f0c7aaeecad9fb26b3da72904f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Fri, 19 Jan 2024 01:00:57 +0800 Subject: [PATCH] fix: follow symlinks when detecting mime-type on Windows (#527) --- yazi-plugin/preset/plugins/mime.lua | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/yazi-plugin/preset/plugins/mime.lua b/yazi-plugin/preset/plugins/mime.lua index fd016c85..bfebcd34 100644 --- a/yazi-plugin/preset/plugins/mime.lua +++ b/yazi-plugin/preset/plugins/mime.lua @@ -6,14 +6,7 @@ function M:preload() urls[#urls + 1] = tostring(file.url) end - local args - if ya.target_family() == "windows" then - args = { "-b", "--mime-type" } - else - args = { "-b", "-L", "--mime-type" } - end - - local child, code = Command("file"):args(args):args(urls):stdout(Command.PIPED):spawn() + local child, code = Command("file"):args({ "-bL", "--mime-type" }):args(urls):stdout(Command.PIPED):spawn() if not child then ya.err("spawn `file` command returns " .. tostring(code)) return 0