Something went wrong. Try again.
Neovim plugin for working with Github pull request comments
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334local GhPrUtils = {}
---@return string[]local function construct_headers() return { "-H", "Accept: application/vnd.github+json", "-H", "X-GitHub-Api-Version: 2022-11-28", "-H", "Authorization: Bearer " .. vim.env["GITHUB_TOKEN"], }end
GhPrUtils.http_get = function(url, cb) local cmd = { "curl", "-sL" } vim.list_extend(cmd, construct_headers()) vim.list_extend(cmd, { url }) vim.system(cmd, { text = true }, function(res) vim.schedule(function() if res == "" or res.code ~= 0 then cb(nil, res.stderr) return end cb(res.stdout, nil) end) end)end
---@param err stringGhPrUtils.err_notify = function(err) vim.notify(err, vim.log.levels.ERROR, { title = "gh-pr-comments.nvim" })end
return GhPrUtils