mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:50:06 +08:00
commit
096a72df53
@ -6,10 +6,12 @@ endfunction
|
|||||||
let s:self = {}
|
let s:self = {}
|
||||||
let s:self.jobs = {}
|
let s:self.jobs = {}
|
||||||
let s:self.nvim_job = has('nvim')
|
let s:self.nvim_job = has('nvim')
|
||||||
let s:self.vim_job = !has('nvim') && has('job') && has('patch-7.4.1590')
|
let s:self.vim_job = !has('nvim') && has('job') && has('patch-8.0.0027')
|
||||||
|
let s:self.vim_co = SpaceVim#api#import('vim#compatible')
|
||||||
|
|
||||||
function! s:self.warn(...) abort
|
function! s:self.warn(...) abort
|
||||||
if len(a:000) == 0
|
if len(a:000) == 0
|
||||||
echohl WarningMsg | echom 'Current version do not support job feature!' | echohl None
|
echohl WarningMsg | echom 'Current version do not support job feature, fallback to sync system()' | echohl None
|
||||||
elseif len(a:000) == 1 && type(a:1) == type('')
|
elseif len(a:000) == 1 && type(a:1) == type('')
|
||||||
echohl WarningMsg | echom a:1| echohl None
|
echohl WarningMsg | echom a:1| echohl None
|
||||||
else
|
else
|
||||||
@ -88,7 +90,34 @@ function! s:self.start(argv, ...) abort
|
|||||||
call extend(self.jobs, {id : job})
|
call extend(self.jobs, {id : job})
|
||||||
return id
|
return id
|
||||||
else
|
else
|
||||||
call self.warn()
|
if len(a:000) > 0
|
||||||
|
let opts = a:1
|
||||||
|
else
|
||||||
|
let opts = {}
|
||||||
|
endif
|
||||||
|
if has_key(opts, 'cwd')
|
||||||
|
let old_wd = getcwd()
|
||||||
|
let cwd = expand(opts.cwd, 1)
|
||||||
|
exe 'cd' fnameescape(cwd)
|
||||||
|
endif
|
||||||
|
let output = self.vim_co.systemlist(a:argv)
|
||||||
|
if exists('old_wd')
|
||||||
|
exe 'cd' fnameescape(old_wd)
|
||||||
|
endif
|
||||||
|
let id = -1
|
||||||
|
if v:shell_error
|
||||||
|
if has_key(opts,'on_stderr')
|
||||||
|
call call(opts.on_stderr, [id, output, 'stderr'])
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
if has_key(opts,'on_stdout')
|
||||||
|
call call(opts.on_stdout, [id, output, 'stdout'])
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if has_key(opts,'on_exit')
|
||||||
|
call call(opts.on_exit, [id, v:shell_error, 'exit'])
|
||||||
|
endif
|
||||||
|
return id
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ function! SpaceVim#api#vim#compatible#get() abort
|
|||||||
return map({
|
return map({
|
||||||
\ 'execute' : '',
|
\ 'execute' : '',
|
||||||
\ 'system' : '',
|
\ 'system' : '',
|
||||||
|
\ 'systemlist' : '',
|
||||||
\ },
|
\ },
|
||||||
\ "function('s:' . v:key)"
|
\ "function('s:' . v:key)"
|
||||||
\ )
|
\ )
|
||||||
@ -29,6 +30,9 @@ if has('nvim')
|
|||||||
function! s:system(cmd, ...) abort
|
function! s:system(cmd, ...) abort
|
||||||
return a:0 == 0 ? system(a:cmd) : system(a:cmd, a:1)
|
return a:0 == 0 ? system(a:cmd) : system(a:cmd, a:1)
|
||||||
endfunction
|
endfunction
|
||||||
|
function! s:systemlist(cmd, ...) abort
|
||||||
|
return a:0 == 0 ? systemlist(a:cmd) : systemlist(a:cmd, a:1)
|
||||||
|
endfunction
|
||||||
else
|
else
|
||||||
function! s:system(cmd, ...) abort
|
function! s:system(cmd, ...) abort
|
||||||
if type(a:cmd) == 3
|
if type(a:cmd) == 3
|
||||||
@ -39,6 +43,15 @@ else
|
|||||||
return a:0 == 0 ? system(a:cmd) : system(a:cmd, a:1)
|
return a:0 == 0 ? system(a:cmd) : system(a:cmd, a:1)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
function! s:systemlist(cmd, ...) abort
|
||||||
|
if type(a:cmd) == 3
|
||||||
|
let cmd = map(a:cmd, 'shellescape(v:val)')
|
||||||
|
let cmd = join(cmd, ' ')
|
||||||
|
return a:0 == 0 ? systemlist(cmd) : systemlist(cmd, a:1)
|
||||||
|
else
|
||||||
|
return a:0 == 0 ? systemlist(a:cmd) : systemlist(a:cmd, a:1)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" vim:set et sw=2 cc=80:
|
" vim:set et sw=2 cc=80:
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
" TODO add airline support for plugin manager
|
|
||||||
" TODO add install function for plugin manager
|
|
||||||
|
|
||||||
" Load SpaceVim api
|
" Load SpaceVim api
|
||||||
let s:VIM_CO = SpaceVim#api#import('vim#compatible')
|
let s:VIM_CO = SpaceVim#api#import('vim#compatible')
|
||||||
let s:JOB = SpaceVim#api#import('job')
|
let s:JOB = SpaceVim#api#import('job')
|
||||||
@ -23,6 +20,7 @@ let s:building_repos = {}
|
|||||||
let s:ui_buf = {}
|
let s:ui_buf = {}
|
||||||
let s:plugin_manager_buffer = 0
|
let s:plugin_manager_buffer = 0
|
||||||
let s:plugin_manager_buffer_lines = []
|
let s:plugin_manager_buffer_lines = []
|
||||||
|
let s:jobpid = 0
|
||||||
|
|
||||||
" install plugin manager
|
" install plugin manager
|
||||||
function! s:install_manager() abort
|
function! s:install_manager() abort
|
||||||
@ -168,8 +166,12 @@ function! SpaceVim#plugins#manager#update(...) abort
|
|||||||
elseif status == 1
|
elseif status == 1
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
redraw!
|
||||||
let s:pct = 0
|
let s:pct = 0
|
||||||
let s:pct_done = 0
|
let s:pct_done = 0
|
||||||
|
if exists('s:recache_done')
|
||||||
|
unlet s:recache_done
|
||||||
|
endif
|
||||||
let s:plugins = a:0 == 0 ? sort(keys(dein#get())) : sort(copy(a:1))
|
let s:plugins = a:0 == 0 ? sort(keys(dein#get())) : sort(copy(a:1))
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
call add(s:plugins, 'SpaceVim')
|
call add(s:plugins, 'SpaceVim')
|
||||||
@ -217,19 +219,27 @@ endfunction
|
|||||||
|
|
||||||
" here if a:data == 0, git pull succeed
|
" here if a:data == 0, git pull succeed
|
||||||
function! s:on_pull_exit(id, data, event) abort
|
function! s:on_pull_exit(id, data, event) abort
|
||||||
if a:data == 0 && a:event ==# 'exit'
|
if a:id == -1
|
||||||
call s:msg_on_updated_done(s:pulling_repos[a:id].name)
|
let id = s:jobpid
|
||||||
else
|
else
|
||||||
call s:msg_on_updated_failed(s:pulling_repos[a:id].name)
|
let id = a:id
|
||||||
endif
|
endif
|
||||||
if get(s:pulling_repos[a:id], 'build', '') !=# ''
|
if a:data == 0 && a:event ==# 'exit'
|
||||||
call s:build(s:pulling_repos[a:id])
|
call s:msg_on_updated_done(s:pulling_repos[id].name)
|
||||||
|
else
|
||||||
|
call s:msg_on_updated_failed(s:pulling_repos[id].name)
|
||||||
|
endif
|
||||||
|
if a:id == -1
|
||||||
|
redraw!
|
||||||
|
endif
|
||||||
|
if get(s:pulling_repos[id], 'build', '') !=# ''
|
||||||
|
call s:build(s:pulling_repos[id])
|
||||||
else
|
else
|
||||||
let s:pct_done += 1
|
let s:pct_done += 1
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')')
|
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')')
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
||||||
endif
|
endif
|
||||||
call remove(s:pulling_repos, string(a:id))
|
call remove(s:pulling_repos, string(id))
|
||||||
if !empty(s:plugins)
|
if !empty(s:plugins)
|
||||||
let name = s:LIST.shift(s:plugins)
|
let name = s:LIST.shift(s:plugins)
|
||||||
if name ==# 'SpaceVim'
|
if name ==# 'SpaceVim'
|
||||||
@ -242,7 +252,12 @@ function! s:on_pull_exit(id, data, event) abort
|
|||||||
endif
|
endif
|
||||||
call s:pull(repo)
|
call s:pull(repo)
|
||||||
endif
|
endif
|
||||||
if empty(s:pulling_repos) && empty(s:building_repos)
|
call s:recache_rtp(a:id)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:recache_rtp(id) abort
|
||||||
|
if empty(s:pulling_repos) && empty(s:building_repos) && !exists('s:recache_done')
|
||||||
" TODO add elapsed time info.
|
" TODO add elapsed time info.
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updated. Elapsed time: '
|
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updated. Elapsed time: '
|
||||||
\ . split(reltimestr(reltime(s:start_time)))[0] . ' sec.')
|
\ . split(reltimestr(reltime(s:start_time)))[0] . ' sec.')
|
||||||
@ -250,16 +265,24 @@ function! s:on_pull_exit(id, data, event) abort
|
|||||||
if g:spacevim_plugin_manager ==# 'dein'
|
if g:spacevim_plugin_manager ==# 'dein'
|
||||||
call dein#recache_runtimepath()
|
call dein#recache_runtimepath()
|
||||||
endif
|
endif
|
||||||
|
if a:id == -1
|
||||||
|
let s:recache_done = 1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" @vimlint(EVL103, 1, a:event)
|
" @vimlint(EVL103, 1, a:event)
|
||||||
function! s:on_install_stdout(id, data, event) abort
|
function! s:on_install_stdout(id, data, event) abort
|
||||||
|
if a:id == -1
|
||||||
|
let id = s:jobpid
|
||||||
|
else
|
||||||
|
let id = a:id
|
||||||
|
endif
|
||||||
for str in a:data
|
for str in a:data
|
||||||
let status = matchstr(str,'\d\+%\s(\d\+/\d\+)')
|
let status = matchstr(str,'\d\+%\s(\d\+/\d\+)')
|
||||||
if !empty(status)
|
if !empty(status)
|
||||||
call s:msg_on_install_process(s:pulling_repos[a:id].name, status)
|
call s:msg_on_install_process(s:pulling_repos[id].name, status)
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
@ -271,68 +294,73 @@ function! s:lock_revision(repo) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_build_exit(id, data, event) abort
|
function! s:on_build_exit(id, data, event) abort
|
||||||
if a:data == 0 && a:event ==# 'exit'
|
if a:id == -1
|
||||||
call s:msg_on_build_done(s:building_repos[a:id].name)
|
let id = s:jobpid
|
||||||
else
|
else
|
||||||
call s:msg_on_build_failed(s:building_repos[a:id].name)
|
let id = a:id
|
||||||
|
endif
|
||||||
|
if a:data == 0 && a:event ==# 'exit'
|
||||||
|
call s:msg_on_build_done(s:building_repos[id].name)
|
||||||
|
else
|
||||||
|
call s:msg_on_build_failed(s:building_repos[id].name)
|
||||||
endif
|
endif
|
||||||
let s:pct_done += 1
|
let s:pct_done += 1
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')')
|
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')')
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
||||||
call remove(s:building_repos, string(a:id))
|
call remove(s:building_repos, string(id))
|
||||||
if empty(s:pulling_repos) && empty(s:building_repos)
|
call s:recache_rtp(a:id)
|
||||||
" TODO add elapsed time info.
|
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Installed. Elapsed time: '
|
|
||||||
\ . split(reltimestr(reltime(s:start_time)))[0] . ' sec.')
|
|
||||||
let s:plugin_manager_buffer = 0
|
|
||||||
if g:spacevim_plugin_manager ==# 'dein'
|
|
||||||
call dein#recache_runtimepath()
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" here if a:data == 0, git pull succeed
|
" here if a:data == 0, git pull succeed
|
||||||
function! s:on_install_exit(id, data, event) abort
|
function! s:on_install_exit(id, data, event) abort
|
||||||
if a:data == 0 && a:event ==# 'exit'
|
if a:id == -1
|
||||||
call s:msg_on_install_done(s:pulling_repos[a:id].name)
|
let id = s:jobpid
|
||||||
else
|
else
|
||||||
call s:msg_on_install_failed(s:pulling_repos[a:id].name)
|
let id = a:id
|
||||||
endif
|
endif
|
||||||
if get(s:pulling_repos[a:id], 'rev', '') !=# ''
|
if a:data == 0 && a:event ==# 'exit'
|
||||||
call s:lock_revision(s:pulling_repos[a:id])
|
call s:msg_on_install_done(s:pulling_repos[id].name)
|
||||||
|
else
|
||||||
|
call s:msg_on_install_failed(s:pulling_repos[id].name)
|
||||||
endif
|
endif
|
||||||
if get(s:pulling_repos[a:id], 'build', '') !=# ''
|
if get(s:pulling_repos[id], 'rev', '') !=# ''
|
||||||
call s:build(s:pulling_repos[a:id])
|
call s:lock_revision(s:pulling_repos[id])
|
||||||
|
endif
|
||||||
|
if get(s:pulling_repos[id], 'build', '') !=# ''
|
||||||
|
call s:build(s:pulling_repos[id])
|
||||||
else
|
else
|
||||||
let s:pct_done += 1
|
let s:pct_done += 1
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')')
|
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')')
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar())
|
||||||
endif
|
endif
|
||||||
call remove(s:pulling_repos, string(a:id))
|
call remove(s:pulling_repos, string(id))
|
||||||
if !empty(s:plugins)
|
if !empty(s:plugins)
|
||||||
call s:install(dein#get(s:LIST.shift(s:plugins)))
|
call s:install(dein#get(s:LIST.shift(s:plugins)))
|
||||||
endif
|
endif
|
||||||
if empty(s:pulling_repos) && empty(s:building_repos)
|
call s:recache_rtp(a:id)
|
||||||
" TODO add elapsed time info.
|
|
||||||
call s:set_buf_line(s:plugin_manager_buffer, 1, 'Installed. Elapsed time: '
|
|
||||||
\ . split(reltimestr(reltime(s:start_time)))[0] . ' sec.')
|
|
||||||
let s:plugin_manager_buffer = 0
|
|
||||||
if g:spacevim_plugin_manager ==# 'dein'
|
|
||||||
call dein#recache_runtimepath()
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:pull(repo) abort
|
function! s:pull(repo) abort
|
||||||
let s:pct += 1
|
let s:pct += 1
|
||||||
let s:ui_buf[a:repo.name] = s:pct
|
let s:ui_buf[a:repo.name] = s:pct
|
||||||
let argv = ['git', '-C', a:repo.path, 'pull']
|
let argv = ['git', '-C', a:repo.path, 'pull']
|
||||||
let jobid = s:JOB.start(argv,{
|
if s:JOB.vim_job || s:JOB.nvim_job
|
||||||
\ 'on_exit' : function('s:on_pull_exit')
|
let jobid = s:JOB.start(argv,{
|
||||||
\ })
|
\ 'on_exit' : function('s:on_pull_exit')
|
||||||
if jobid != 0
|
\ })
|
||||||
let s:pulling_repos[jobid] = a:repo
|
if jobid != 0
|
||||||
|
let s:pulling_repos[jobid] = a:repo
|
||||||
|
call s:msg_on_start(a:repo.name)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let s:jobpid += 1
|
||||||
|
let s:pulling_repos[s:jobpid] = a:repo
|
||||||
call s:msg_on_start(a:repo.name)
|
call s:msg_on_start(a:repo.name)
|
||||||
|
redraw!
|
||||||
|
call s:JOB.start(argv,{
|
||||||
|
\ 'on_exit' : function('s:on_pull_exit')
|
||||||
|
\ })
|
||||||
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -341,25 +369,48 @@ function! s:install(repo) abort
|
|||||||
let s:ui_buf[a:repo.name] = s:pct
|
let s:ui_buf[a:repo.name] = s:pct
|
||||||
let url = 'https://github.com/' . a:repo.repo
|
let url = 'https://github.com/' . a:repo.repo
|
||||||
let argv = ['git', 'clone', '--progress', url, a:repo.path]
|
let argv = ['git', 'clone', '--progress', url, a:repo.path]
|
||||||
let jobid = s:JOB.start(argv,{
|
if s:JOB.vim_job || s:JOB.nvim_job
|
||||||
\ 'on_stderr' : function('s:on_install_stdout'),
|
let jobid = s:JOB.start(argv,{
|
||||||
\ 'on_exit' : function('s:on_install_exit')
|
\ 'on_stderr' : function('s:on_install_stdout'),
|
||||||
\ })
|
\ 'on_exit' : function('s:on_install_exit')
|
||||||
if jobid != 0
|
\ })
|
||||||
let s:pulling_repos[jobid] = a:repo
|
if jobid != 0
|
||||||
call s:msg_on_install_start(a:repo.name)
|
let s:pulling_repos[jobid] = a:repo
|
||||||
|
call s:msg_on_install_start(a:repo.name)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let s:jobpid += 1
|
||||||
|
let s:pulling_repos[s:jobpid] = a:repo
|
||||||
|
call s:msg_on_start(a:repo.name)
|
||||||
|
redraw!
|
||||||
|
call s:JOB.start(argv,{
|
||||||
|
\ 'on_stderr' : function('s:on_install_stdout'),
|
||||||
|
\ 'on_exit' : function('s:on_install_exit')
|
||||||
|
\ })
|
||||||
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:build(repo) abort
|
function! s:build(repo) abort
|
||||||
let argv = type(a:repo.build) != 4 ? a:repo.build : s:get_build_argv(a:repo.build)
|
let argv = type(a:repo.build) != 4 ? a:repo.build : s:get_build_argv(a:repo.build)
|
||||||
let jobid = s:JOB.start(argv,{
|
if s:JOB.vim_job || s:JOB.nvim_job
|
||||||
\ 'on_exit' : function('s:on_build_exit'),
|
let jobid = s:JOB.start(argv,{
|
||||||
\ 'cwd' : a:repo.path,
|
\ 'on_exit' : function('s:on_build_exit'),
|
||||||
\ })
|
\ 'cwd' : a:repo.path,
|
||||||
if jobid != 0
|
\ })
|
||||||
let s:building_repos[jobid] = a:repo
|
if jobid != 0
|
||||||
|
let s:building_repos[jobid] = a:repo
|
||||||
|
call s:msg_on_build_start(a:repo.name)
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let s:building_repos[s:jobpid] = a:repo
|
||||||
call s:msg_on_build_start(a:repo.name)
|
call s:msg_on_build_start(a:repo.name)
|
||||||
|
redraw!
|
||||||
|
call s:JOB.start(argv,{
|
||||||
|
\ 'on_exit' : function('s:on_build_exit'),
|
||||||
|
\ 'cwd' : a:repo.path,
|
||||||
|
\ })
|
||||||
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ Execute ( SpaceVim api: job ):
|
|||||||
let argv = ['cat']
|
let argv = ['cat']
|
||||||
let g:stdout = ''
|
let g:stdout = ''
|
||||||
let stderr = ''
|
let stderr = ''
|
||||||
let exit = 1
|
let exit_data = 1
|
||||||
function! s:on_stdout(id, data, event) abort
|
function! s:on_stdout(id, data, event) abort
|
||||||
if a:event ==# 'stdout'
|
if a:event ==# 'stdout'
|
||||||
for a in a:data
|
for a in a:data
|
||||||
@ -12,7 +12,7 @@ Execute ( SpaceVim api: job ):
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
elseif a:event ==# 'exit'
|
elseif a:event ==# 'exit'
|
||||||
let g:exit = a:data
|
let g:exit_data = a:data
|
||||||
else
|
else
|
||||||
let g:stderr = a:data
|
let g:stderr = a:data
|
||||||
endif
|
endif
|
||||||
@ -23,11 +23,17 @@ Execute ( SpaceVim api: job ):
|
|||||||
\ 'on_exit' : function('s:on_stdout'),
|
\ 'on_exit' : function('s:on_stdout'),
|
||||||
\ }
|
\ }
|
||||||
let jobid = job.start(argv,opt)
|
let jobid = job.start(argv,opt)
|
||||||
call job.send(jobid, 'foo')
|
if jobid >= 0
|
||||||
sleep 10m
|
call job.send(jobid, 'foo')
|
||||||
AssertEqual stdout, 'foo'
|
sleep 10m
|
||||||
AssertEqual job.status(jobid), 'run'
|
AssertEqual stdout, 'foo'
|
||||||
call job.stop(jobid)
|
AssertEqual job.status(jobid), 'run'
|
||||||
AssertEqual exit, 1
|
call job.stop(jobid)
|
||||||
|
AssertEqual exit_data, 1
|
||||||
|
else
|
||||||
|
let jobid = job.start(['echo', 'foo'],opt)
|
||||||
|
AssertEqual stdout, 'foo'
|
||||||
|
AssertEqual exit_data, 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user