Skip to content

Commit

Permalink
fix: fetch validation for non-nightly version
Browse files Browse the repository at this point in the history
Fixes #9
  • Loading branch information
topaxi committed Aug 15, 2024
1 parent 2fce4e3 commit 74d624e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lua/gh-actions/github.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,17 @@ end
---@param path string
---@param opts? table
function M.fetch(server, path, opts)
vim.validate('server', server, 'string')
vim.validate('path', path, 'string')
vim.validate('opts', opts, 'table', true)
if vim.fn.has('nvim-0.11') == 1 then
vim.validate('server', server, 'string')
vim.validate('path', path, 'string')
vim.validate('opts', opts, 'table', true)
else
vim.validate {
server = { server, 'string' },
path = { path, 'string' },
opts = { opts, 'table', true },
}
end

opts = opts or {}
opts.callback = opts.callback and vim.schedule_wrap(opts.callback)
Expand Down

0 comments on commit 74d624e

Please sign in to comment.