fix(trash): do not run trash command when trash is not executable
This commit is contained in:
@@ -45,6 +45,12 @@ function M.fn(node)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local binary = M.config.trash.cmd:gsub(" .*$", "")
|
||||||
|
if vim.fn.executable(binary) == 0 then
|
||||||
|
utils.warn(binary .. " is not executable.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local err_msg = ""
|
local err_msg = ""
|
||||||
local function on_stderr(_, data)
|
local function on_stderr(_, data)
|
||||||
err_msg = err_msg .. (data and table.concat(data, " "))
|
err_msg = err_msg .. (data and table.concat(data, " "))
|
||||||
|
|||||||
Reference in New Issue
Block a user