File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1
- " Copyright (C) 2010-2014 Hong Xu
1
+ " Copyright (C) 2010-2015 Hong Xu
2
2
3
3
" This file is part of SingleCompile.
4
4
@@ -401,6 +401,20 @@ function! SingleCompile#PredoMicrosoftVC(compiling_info) " MSVC Predo {{{2
401
401
return l: new_compiling_info
402
402
endfunction
403
403
404
+ function ! SingleCompile#PredoShell (compiling_info) " shell predo {{{2
405
+ let l: new_compiling_info = a: compiling_info
406
+
407
+ let l: shebang = getline (1 )
408
+ if l: shebang !~ ' #!/.*' " don't change anything if no shebang is found
409
+ return a: compiling_info
410
+ endif
411
+
412
+ " Use the shell indicated by the shebang
413
+ let l: new_compiling_info [' command' ] = matchstr (l: shebang , ' #!\zs/.*' )
414
+
415
+ return l: new_compiling_info
416
+ endfunction
417
+
404
418
" post-do functions {{{1
405
419
function ! SingleCompile#PostdoWatcom (compiling_info) " watcom pre-do {{{2
406
420
let $PATH = s: old_path
Original file line number Diff line number Diff line change 1
- " Copyright (C) 2010-2012 Hong Xu
1
+ " Copyright (C) 2010-2015 Hong Xu
2
2
3
3
" This file is part of SingleCompile.
4
4
18
18
" check doc/SingleCompile.txt for more information
19
19
20
20
function ! SingleCompile#templates#sh#Initialize ()
21
+ call SingleCompile#SetCompilerTemplate (' sh' , ' shell' ,
22
+ \' Guess from shebang' , ' sh ' , '' , ' ')
23
+ call SingleCompile#SetPriority (' sh' , ' shell' , 10 )
24
+ call SingleCompile#SetPredo (' sh' , ' shell' ,
25
+ \f unction (' SingleCompile#PredoShell' ))
21
26
call SingleCompile#SetCompilerTemplate (' sh' , ' sh' ,
22
27
\' Bourne Shell' , ' sh ' , '' , ' ')
23
28
call SingleCompile#SetPriority (' sh' , ' sh' , 80 )
You can’t perform that action at this time.
0 commit comments