mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: follow symlinks when detecting mime-type on Windows (#527)
This commit is contained in:
parent
e987855fca
commit
453ca94e18
1 changed files with 1 additions and 8 deletions
|
|
@ -6,14 +6,7 @@ function M:preload()
|
||||||
urls[#urls + 1] = tostring(file.url)
|
urls[#urls + 1] = tostring(file.url)
|
||||||
end
|
end
|
||||||
|
|
||||||
local args
|
local child, code = Command("file"):args({ "-bL", "--mime-type" }):args(urls):stdout(Command.PIPED):spawn()
|
||||||
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()
|
|
||||||
if not child then
|
if not child then
|
||||||
ya.err("spawn `file` command returns " .. tostring(code))
|
ya.err("spawn `file` command returns " .. tostring(code))
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue