mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
support YAZI_FILE_CMD_PATH environment variable for file(1) path
This commit is contained in:
parent
b6fb02fda3
commit
1338f9acbb
1 changed files with 2 additions and 1 deletions
|
|
@ -15,7 +15,8 @@ function M:preload()
|
|||
urls[#urls + 1] = tostring(file.url)
|
||||
end
|
||||
|
||||
local child, code = Command("file"):args({ "-bL", "--mime-type" }):args(urls):stdout(Command.PIPED):spawn()
|
||||
local file_cmd_path = os.getenv("YAZI_FILE_CMD_PATH") or "file"
|
||||
local child, code = Command(file_cmd_path):args({ "-bL", "--mime-type" }):args(urls):stdout(Command.PIPED):spawn()
|
||||
if not child then
|
||||
ya.err("spawn `file` command returns " .. tostring(code))
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue