parent
347eba475b
commit
1b83645097
|
@ -18,7 +18,7 @@ M: vim vim-command ( file line -- array )
|
|||
: vim-location ( file line -- )
|
||||
vim-command
|
||||
vim-detach get-global
|
||||
[ run-detached ] [ run-process ] if drop ;
|
||||
[ try-detached ] [ try-process ] if ;
|
||||
|
||||
"vim" vim-path set-global
|
||||
[ vim-location ] edit-hook set-global
|
||||
|
|
|
@ -113,6 +113,8 @@ HELP: try-process
|
|||
{ $values { "desc" "a launch descriptor" } }
|
||||
{ $description "Launches a process and waits for it to complete. If it exits with a non-zero status code, throws a " { $link process-failed } " error." } ;
|
||||
|
||||
{ run-process try-process run-detached } related-words
|
||||
|
||||
HELP: kill-process
|
||||
{ $values { "process" process } }
|
||||
{ $description "Kills a running process. Does nothing if the process has already exited." } ;
|
||||
|
@ -171,6 +173,7 @@ ARTICLE: "io.launcher.launch" "Launching processes"
|
|||
"Launching processes:"
|
||||
{ $subsection run-process }
|
||||
{ $subsection try-process }
|
||||
{ $subsection run-detached }
|
||||
"Redirecting standard input and output to a pipe:"
|
||||
{ $subsection <process-stream> }
|
||||
{ $subsection with-process-stream } ;
|
||||
|
|
|
@ -127,10 +127,7 @@ HOOK: run-process* io-backend ( process -- handle )
|
|||
run-detached
|
||||
dup detached>> [ dup wait-for-process drop ] unless ;
|
||||
|
||||
TUPLE: process-failed code ;
|
||||
|
||||
: process-failed ( code -- * )
|
||||
\ process-failed boa throw ;
|
||||
ERROR: process-failed code ;
|
||||
|
||||
: try-process ( desc -- )
|
||||
run-process wait-for-process dup zero?
|
||||
|
|
Loading…
Reference in New Issue