mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
feat: support YAZI_FILE_ONE environment variable for file(1) path (#752)
This commit is contained in:
parent
7f062359e8
commit
8508a5f577
1 changed files with 3 additions and 2 deletions
|
|
@ -15,9 +15,10 @@ 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 cmd = os.getenv("YAZI_FILE_ONE") or "file"
|
||||
local child, code = Command(cmd):args({ "-bL", "--mime-type" }):args(urls):stdout(Command.PIPED):spawn()
|
||||
if not child then
|
||||
ya.err("spawn `file` command returns " .. tostring(code))
|
||||
ya.err(string.format("spawn `%s` command returns %s", cmd, code))
|
||||
return 0
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue