fix(trash): do not run trash command when trash is not executable

This commit is contained in:
kiyan
2022-07-02 12:08:46 +02:00
parent ec09b80c7b
commit cbbc799e6c

View File

@@ -45,6 +45,12 @@ function M.fn(node)
return
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 function on_stderr(_, data)
err_msg = err_msg .. (data and table.concat(data, " "))