improv(trashCmd): use `jit.os` to detect OS
parent
ed3c34d1e4
commit
e04857f290
|
|
@ -4,11 +4,14 @@ local M = {}
|
|||
---@return string|string[]
|
||||
local function setDefaultTrashCmd()
|
||||
local osTrashCmd
|
||||
local system = vim.uv.os_uname().sysname:lower()
|
||||
if system == "darwin" then osTrashCmd = "trash" end
|
||||
if system:find("windows") then osTrashCmd = "trash" end
|
||||
if system:find("linux") then osTrashCmd = { "gio", "trash" } end
|
||||
assert(osTrashCmd, "Unknown operating system. Please provide a custom `trashCmd`.")
|
||||
local system = jit.os:lower()
|
||||
if system == "mac" or system == "osx" then
|
||||
osTrashCmd = "trash"
|
||||
elseif system == "windows" then
|
||||
osTrashCmd = "trash"
|
||||
else
|
||||
osTrashCmd = { "gio", "trash" }
|
||||
end
|
||||
return osTrashCmd
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue