async: correctly use &shell and &shellcmdflag

instead of hardcoding to use 'sh' and '-c'
This commit is contained in:
Christian Brabandt 2020-01-28 16:04:53 +01:00
parent a201689e38
commit 8fbb16f838
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
1 changed files with 6 additions and 6 deletions

View File

@ -134,7 +134,7 @@ if v:version >= 800 && has("job")
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell' if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:cmd let cmd = a:cmd
else else
let cmd = ['sh', '-c', a:cmd] let cmd = [&shell, &shellcmdflag, a:cmd]
endif endif
let options = {'cmd': a:cmd, 'buf': '', 'file': a:file} let options = {'cmd': a:cmd, 'buf': '', 'file': a:file}
@ -179,7 +179,7 @@ if v:version >= 800 && has("job")
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell' if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:cmd let cmd = a:cmd
else else
let cmd = ['sh', '-c', a:cmd] let cmd = [&shell, &shellcmdflag, a:cmd]
endif endif
let options = {'buf': '', 'vcs': a:vcs, 'file': a:file} let options = {'buf': '', 'vcs': a:vcs, 'file': a:file}
@ -205,7 +205,7 @@ if v:version >= 800 && has("job")
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell' if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:config['cmd'] . shellescape(a:file) let cmd = a:config['cmd'] . shellescape(a:file)
else else
let cmd = ['sh', '-c', a:config['cmd'] . shellescape(a:file)] let cmd = [&shell, &shellcmdflag, a:config['cmd'] . shellescape(a:file)]
endif endif
let options = {'cfg': a:config, 'buf': '', 'file': a:file} let options = {'cfg': a:config, 'buf': '', 'file': a:file}
@ -266,7 +266,7 @@ elseif has("nvim")
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell' if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:cmd let cmd = a:cmd
else else
let cmd = ['sh', '-c', a:cmd] let cmd = [&shell, &shellcmdflag, a:cmd]
endif endif
if has_key(s:mq_jobs, a:file) if has_key(s:mq_jobs, a:file)
@ -289,7 +289,7 @@ elseif has("nvim")
" no msgfmt on windows? " no msgfmt on windows?
return return
else else
let cmd = ['sh', '-c', a:cmd. shellescape(a:file)] let cmd = [&shell, &shellcmdflag, a:cmd. shellescape(a:file)]
endif endif
if has_key(s:po_jobs, a:file) if has_key(s:po_jobs, a:file)
@ -311,7 +311,7 @@ elseif has("nvim")
if g:airline#init#is_windows && &shell =~ 'cmd\|powershell' if g:airline#init#is_windows && &shell =~ 'cmd\|powershell'
let cmd = a:cmd let cmd = a:cmd
else else
let cmd = ['sh', '-c', a:cmd] let cmd = [&shell, &shellcmdflag, a:cmd]
endif endif
if !has_key(s:clean_jobs, a:vcs) if !has_key(s:clean_jobs, a:vcs)