fix: sometimes use shell to run trash command (#99)

This commit is contained in:
Steven Arcangeli 2023-08-20 05:10:09 +00:00
parent 9d90893c37
commit ff62fc28cd

View file

@ -4,7 +4,12 @@ local M = {}
M.recursive_delete = function(path, cb)
local stdout = {}
local stderr = {}
local cmd = vim.list_extend(vim.split(config.trash_command, "%s+"), { path })
local cmd
if config.trash_command:find("%s") then
cmd = string.format("%s %s", config.trash_command, vim.fn.shellescape(path))
else
cmd = { config.trash_command, path }
end
local jid = vim.fn.jobstart(cmd, {
stdout_buffered = true,
stderr_buffered = true,