|
|
|
@ -536,7 +536,13 @@ endfunction
|
|
|
|
|
|
|
|
|
|
function! WriteRun()
|
|
|
|
|
:w
|
|
|
|
|
if &filetype == 'go'
|
|
|
|
|
if executable('run.sh')
|
|
|
|
|
" this only works for scripts
|
|
|
|
|
":! eval "%:p" `$bash_tools/lib/args_extract.sh "%:p"` 2>&1 | less
|
|
|
|
|
" but this now works for config files too which can have run headers
|
|
|
|
|
" instead of args headers
|
|
|
|
|
:! "$bash_tools/run.sh" "%:p" 2>&1 | less
|
|
|
|
|
elseif &filetype == 'go'
|
|
|
|
|
" TODO: consider switching this to go build and then run the binary as
|
|
|
|
|
" this gets stdout only at the end so things like welcome.go don't get
|
|
|
|
|
" the transition effects when run like this
|
|
|
|
@ -566,11 +572,7 @@ function! WriteRun()
|
|
|
|
|
elseif expand('%:t') == '.envrc'
|
|
|
|
|
:! bash -c 'cd "%:p:h" && direnv allow .' 2>&1 | less
|
|
|
|
|
else
|
|
|
|
|
" this only works for scripts
|
|
|
|
|
":! eval "%:p" `$bash_tools/lib/args_extract.sh "%:p"` 2>&1 | less
|
|
|
|
|
" but this now works for config files too which can have run headers
|
|
|
|
|
" instead of args headers
|
|
|
|
|
:! "$bash_tools/run.sh" "%:p" 2>&1 | less
|
|
|
|
|
echo "unsupported file type and run.sh not found in PATH"
|
|
|
|
|
endif
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|