mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-15 23:53:18 +00:00
feat(fetch_pr): Introdue the fetch_pr command that allows to pick open
Pull requests from github and import them locally
This commit is contained in:
@@ -51,7 +51,8 @@ end
|
||||
--- @param error_prefix string|nil Optional error message prefix
|
||||
--- @param input string|nil Optional input to pass to stdin
|
||||
--- @param silent boolean|nil Optional to silent the notification
|
||||
function M.execute_command_async(cmd, on_success, error_prefix, input, silent)
|
||||
--- @param on_error function|nil Callback on error, receives ouptut as the parameter
|
||||
function M.execute_command_async(cmd, on_success, error_prefix, input, silent, on_error)
|
||||
local output_lines = {}
|
||||
|
||||
local job_id = vim.fn.jobstart({ "sh", "-c", cmd }, {
|
||||
@@ -85,6 +86,9 @@ function M.execute_command_async(cmd, on_success, error_prefix, input, silent)
|
||||
if not silent then
|
||||
vim.notify(error_message, vim.log.levels.ERROR, { title = "JJ" })
|
||||
end
|
||||
if on_error then
|
||||
on_error(output)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user