Skip to content

Commit

Permalink
feat: add xdg-open to support linux
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroSuero authored Sep 6, 2024
1 parent b402836 commit 6214bd8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/freeze/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ end
---@return string
local function open_by_os(args)
local is_win = vim.loop.os_uname().sysname:match("Windows")
local is_linux = vim.loop.os_uname().sysname:match("Linux")
local output = vim.fn.expand(args.output)
local cmd = {}
if is_win then
table.insert(cmd, "explorer")
elseif is_linux then
table.insert(cmd, "xdg-open")
else
-- Maybe we should use xdg-open here too?
table.insert(cmd, "open")
end
table.insert(cmd, output)
Expand Down

0 comments on commit 6214bd8

Please sign in to comment.