mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
feat: prevent paths from being treated as options in file command (#1783)
This commit is contained in:
parent
1acd7ca80f
commit
3e8ac856cf
2 changed files with 2 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ local M = {}
|
|||
|
||||
function M:peek()
|
||||
local cmd = os.getenv("YAZI_FILE_ONE") or "file"
|
||||
local output, code = Command(cmd):args({ "-bL", tostring(self.file.url) }):stdout(Command.PIPED):output()
|
||||
local output, code = Command(cmd):args({ "-bL", "--", tostring(self.file.url) }):stdout(Command.PIPED):output()
|
||||
|
||||
local text
|
||||
if output then
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ function M:fetch()
|
|||
end
|
||||
|
||||
local cmd = os.getenv("YAZI_FILE_ONE") or "file"
|
||||
local child, code = Command(cmd):args({ "-bL", "--mime-type" }):args(urls):stdout(Command.PIPED):spawn()
|
||||
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", cmd, code))
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue