mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(explorer): macos has trash pre-installed, so no need to try osascript and move to first. Closes #2349
Some checks are pending
CI / ci (push) Waiting to run
Some checks are pending
CI / ci (push) Waiting to run
This commit is contained in:
parent
37cae803ef
commit
d569072b2e
1 changed files with 2 additions and 8 deletions
|
|
@ -13,18 +13,12 @@ local M = {}
|
|||
function M.get_trash_cmds(path)
|
||||
---@type string[][]
|
||||
local ret = {
|
||||
{ "gio", "trash", path }, -- Most universally available on modern Linux
|
||||
{ "trash", path }, -- trash-cli (Python or Node.js)
|
||||
{ "gio", "trash", path }, -- Most universally available on modern Linux
|
||||
{ "kioclient5", "move", path, "trash:/" }, -- KDE Plasma 5
|
||||
{ "kioclient", "move", path, "trash:/" }, -- KDE Plasma 6
|
||||
}
|
||||
if vim.fn.has("mac") == 1 then
|
||||
ret[#ret + 1] = {
|
||||
"osascript",
|
||||
"-e",
|
||||
('tell application "Finder" to delete POSIX file "%s"'):format(path:gsub("\\", "\\\\"):gsub('"', '\\"')),
|
||||
}
|
||||
elseif vim.fn.has("win32") == 1 then
|
||||
if vim.fn.has("win32") == 1 then
|
||||
ret[#ret + 1] = {
|
||||
"powershell",
|
||||
"-NoProfile",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue