Skip to content

Commit

Permalink
fix: allow functions that return strings for output
Browse files Browse the repository at this point in the history
  • Loading branch information
timteeee committed Nov 13, 2024
1 parent cc8f094 commit 5f44892
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/freeze/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ end
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 output
if type(args.output) == "function" then
output = vim.fn.expand(args.output())
else
output = vim.fn.expand(args.output)
end
local cmd = {}
if is_win then
table.insert(cmd, "explorer")
Expand Down

0 comments on commit 5f44892

Please sign in to comment.