mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:20:06 +08:00
fix(github.vim): handle curl command error
This commit is contained in:
parent
d45150caba
commit
5ac713041d
@ -9,8 +9,13 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
function! github#api#users#starred(user, page) abort
|
function! github#api#users#starred(user, page) abort
|
||||||
return json_decode(join(systemlist('curl -s https://api.github.com/users/' .
|
let result = system('curl -s https://api.github.com/users/' .
|
||||||
\a:user . '/starred' . '?page=' . a:page ),"\n"))
|
\ 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
|
endfunction
|
||||||
|
|
||||||
function! github#api#users#starred_pages(user) abort
|
function! github#api#users#starred_pages(user) abort
|
||||||
|
Loading…
Reference in New Issue
Block a user