1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:20:04 +08:00

Fix build cwd option catch

This commit is contained in:
wsdjeg 2017-04-22 15:42:01 +08:00
parent 0f88225ab3
commit 83882ba74f
2 changed files with 10 additions and 1 deletions

View File

@ -95,7 +95,15 @@ function! s:self.start(argv, ...) abort
else else
let opts = {} let opts = {}
endif 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) let output = self.vim_co.systemlist(a:argv)
if exists('old_wd')
exe 'cd' fnameescape(old_wd)
endif
let id = -1 let id = -1
if v:shell_error if v:shell_error
if has_key(opts,'on_stderr') if has_key(opts,'on_stderr')

View File

@ -396,7 +396,8 @@ function! s:build(repo) abort
call s:msg_on_build_start(a:repo.name) call s:msg_on_build_start(a:repo.name)
redraw! redraw!
call s:JOB.start(argv,{ call s:JOB.start(argv,{
\ 'on_exit' : function('s:on_build_exit') \ 'on_exit' : function('s:on_build_exit'),
\ 'cwd' : a:repo.path,
\ }) \ })
endif endif