mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 06:50:04 +08:00
fix(github.vim): handle curl command error
This commit is contained in:
parent
d45150caba
commit
5ac713041d
11
bundle/github.vim/autoload/github/api/users.vim
vendored
11
bundle/github.vim/autoload/github/api/users.vim
vendored
@ -8,9 +8,14 @@ function! github#api#users#GetAllUsers() abort
|
||||
endfunction
|
||||
|
||||
|
||||
function! github#api#users#starred(user,page) abort
|
||||
return json_decode(join(systemlist('curl -s https://api.github.com/users/' .
|
||||
\a:user . '/starred' . '?page=' . a:page ),"\n"))
|
||||
function! github#api#users#starred(user, page) abort
|
||||
let result = system('curl -s https://api.github.com/users/' .
|
||||
\ a:user . '/starred' . '?page=' . a:page)
|
||||
if !v:shell_error
|
||||
return json_decode(result)
|
||||
endif
|
||||
" if the command run failed, return empty list
|
||||
return []
|
||||
endfunction
|
||||
|
||||
function! github#api#users#starred_pages(user) abort
|
||||
|
Loading…
Reference in New Issue
Block a user