2017-07-10 16:35:35 -04:00
|
|
|
Before:
|
|
|
|
Save &shell
|
|
|
|
Save &shellcmdflag
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
let g:ale_has_override = {}
|
|
|
|
|
|
|
|
Execute(sh should be used when the shell is fish):
|
|
|
|
" Set something else, so we will replace that too.
|
|
|
|
let &shellcmdflag = '-f'
|
2017-09-10 19:47:27 -04:00
|
|
|
let g:ale_has_override = {'win32': 0}
|
2017-07-10 16:35:35 -04:00
|
|
|
|
|
|
|
let &shell = 'fish'
|
|
|
|
|
|
|
|
AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand('foobar')
|
|
|
|
|
|
|
|
let &shell = '/usr/bin/fish'
|
|
|
|
|
|
|
|
AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand('foobar')
|
|
|
|
|
|
|
|
let &shell = '/usr/local/bin/fish'
|
|
|
|
|
|
|
|
AssertEqual ['/bin/sh', '-c', 'foobar'], ale#job#PrepareCommand('foobar')
|
|
|
|
|
|
|
|
Execute(Other shells should be used when set):
|
|
|
|
let &shell = '/bin/bash'
|
|
|
|
let &shellcmdflag = '-c'
|
2017-09-10 19:47:27 -04:00
|
|
|
let g:ale_has_override = {'win32': 0}
|
2017-07-10 16:35:35 -04:00
|
|
|
|
|
|
|
AssertEqual ['/bin/bash', '-c', 'foobar'], ale#job#PrepareCommand('foobar')
|
|
|
|
|
|
|
|
Execute(cmd /c as a string should be used on Windows):
|
|
|
|
let &shell = 'who cares'
|
|
|
|
let &shellcmdflag = 'whatever'
|
|
|
|
let g:ale_has_override = {'win32': 1}
|
|
|
|
|
|
|
|
AssertEqual 'cmd /c foobar', ale#job#PrepareCommand('foobar')
|