Handle arguments to shells in shebang lines too.
This commit is contained in:
parent
9d52d968db
commit
2d32c31205
@ -18,8 +18,11 @@ function! ale_linters#sh#shell#GetExecutable(buffer)
|
|||||||
|
|
||||||
" Take the shell executable from the hashbang, if we can.
|
" Take the shell executable from the hashbang, if we can.
|
||||||
if len(banglines) == 1 && banglines[0] =~# '^#!'
|
if len(banglines) == 1 && banglines[0] =~# '^#!'
|
||||||
|
" Remove options like -e, etc.
|
||||||
|
let line = substitute(banglines[0], '--\?[a-zA-Z0-9]\+', '', 'g')
|
||||||
|
|
||||||
for possible_shell in ['bash', 'tcsh', 'csh', 'zsh', 'sh']
|
for possible_shell in ['bash', 'tcsh', 'csh', 'zsh', 'sh']
|
||||||
if banglines[0] =~# possible_shell . '\s*$'
|
if line =~# possible_shell . '\s*$'
|
||||||
return possible_shell
|
return possible_shell
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
Loading…
Reference in New Issue
Block a user