mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 02:40:05 +08:00
Merge branch 'install_status' into dev
This commit is contained in:
commit
f26af7a6a7
@ -213,6 +213,17 @@ function! s:on_pull_exit(id, data, event) abort
|
||||
|
||||
endfunction
|
||||
|
||||
" @vimlint(EVL103, 1, a:event)
|
||||
function! s:on_install_stdout(id, data, event) abort
|
||||
for str in a:data
|
||||
let status = matchstr(str,'\d\+%\s(\d\+/\d\+)')
|
||||
if !empty(status)
|
||||
call s:msg_on_install_process(s:pulling_repos[a:id].name, status)
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
" @vimlint(EVL103, 0, a:event)
|
||||
|
||||
" here if a:data == 0, git pull succeed
|
||||
function! s:on_install_exit(id, data, event) abort
|
||||
if a:data == 0 && a:event ==# 'exit'
|
||||
@ -254,8 +265,9 @@ function! s:install(repo) abort
|
||||
let s:pct += 1
|
||||
let s:ui_buf[a:repo.name] = s:pct
|
||||
let url = 'https://github.com/' . a:repo.repo
|
||||
let argv = ['git', 'clone', url, a:repo.path]
|
||||
let argv = ['git', 'clone', '--progress', url, a:repo.path]
|
||||
let jobid = s:JOB.start(argv,{
|
||||
\ 'on_stderr' : function('s:on_install_stdout'),
|
||||
\ 'on_exit' : function('s:on_install_exit')
|
||||
\ })
|
||||
if jobid != 0
|
||||
@ -291,6 +303,11 @@ function! s:msg_on_updated_failed(name) abort
|
||||
call s:set_buf_line(s:plugin_manager_buffer, s:ui_buf[a:name] + 3, '- ' . a:name . ': Updating failed.')
|
||||
endfunction
|
||||
|
||||
function! s:msg_on_install_process(name, status) abort
|
||||
call s:set_buf_line(s:plugin_manager_buffer, s:ui_buf[a:name] + 3,
|
||||
\ '- ' . a:name . ': Installing ' . a:status)
|
||||
endfunction
|
||||
|
||||
" - foo.vim: Updating done.
|
||||
function! s:msg_on_install_done(name) abort
|
||||
call s:set_buf_line(s:plugin_manager_buffer, s:ui_buf[a:name] + 3, '- ' . a:name . ': Installing done.')
|
||||
|
Loading…
Reference in New Issue
Block a user