mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 05:40:05 +08:00
Add func for report issue
This commit is contained in:
parent
ae1860b0d6
commit
57597072bd
@ -4,6 +4,7 @@ endfunction
|
||||
|
||||
function! s:open() abort
|
||||
exe 'tabnew ' . tempname() . '/issue_report.md'
|
||||
let b:spacevim_issue_template = 1
|
||||
call setline(1, s:template())
|
||||
w
|
||||
endfunction
|
||||
@ -33,3 +34,22 @@ function! s:template() abort
|
||||
return info
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
function! SpaceVim#issue#new()
|
||||
if get(b:, 'spacevim_issue_template', 0) == 1
|
||||
let title = input('Issue title:')
|
||||
let username = input('github username:')
|
||||
let password = input('github password:')
|
||||
let issue = {'title' : title,
|
||||
\ 'body' : join(getline(1, '$'), "\n"),
|
||||
\ }
|
||||
let response = github#api#issues#Create('SpaceVim', 'SpaceVim', username, password, issue)
|
||||
let g:wsd = response
|
||||
if has_key(response, 'html_url')
|
||||
echo 'Issue created done: ' . response.html_url
|
||||
else
|
||||
echo 'Failed to create issue, please check the username and password'
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
Loading…
Reference in New Issue
Block a user