Rename YAZI_FILE_CMD_PATH to YAZI_FILE_ONE

This commit is contained in:
sxyazi 2024-03-01 11:15:48 +08:00
parent c5b7186ea8
commit 327ff90a6b
No known key found for this signature in database

View file

@ -15,10 +15,10 @@ function M:preload()
urls[#urls + 1] = tostring(file.url)
end
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()
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(string.format("spawn `%s` command returns %s", file_cmd_path, tostring(code)))
ya.err(string.format("spawn `%s` command returns %s", cmd, code))
return 0
end