cleanup: remove deprecated trash_command

This commit is contained in:
Steven Arcangeli 2026-01-01 00:22:21 -05:00
parent 78ed0cf7d9
commit 81b8a91735
4 changed files with 2 additions and 62 deletions

View file

@ -1,44 +0,0 @@
local config = require("oil.config")
local M = {}
M.recursive_delete = function(path, cb)
local stdout = {}
local stderr = {}
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,
on_stdout = function(j, output)
stdout = output
end,
on_stderr = function(j, output)
stderr = output
end,
on_exit = function(j, exit_code)
if exit_code == 0 then
cb()
else
cb(
string.format(
"Error moving '%s' to trash:\n stdout: %s\n stderr: %s",
path,
table.concat(stdout, "\n "),
table.concat(stderr, "\n ")
)
)
end
end,
})
if jid == 0 then
cb(string.format("Passed invalid argument '%s' to '%s'", path, config.trash_command))
elseif jid == -1 then
cb(string.format("'%s' is not executable", config.trash_command))
end
end
return M