const classstudsTools::Proc
sys::Obj studsTools::Proc
Utilities for running and working with native processes.
- abort
Print the
msg
and exit with error code.- bash
static Int bash(Str bash, Buf? out := null, Bool checked := true)
Convenience for run to evaluate a bash script.
- download
static Void download(Str msg, Uri uri, File target)
Download content from URI and pipe to given file. Progress will be written to
out
prefixed withmsg
.- run
static Int run(Obj cmd, Obj? stdout := null, Bool checked := true)
Invoke the command string and return 0 if child process exited normally. If child process returns a non-zero exit code and
checked
is true, then abort this process with an error message. Ifchecked
isfalse
then return the child process error code.By default, stdout will be redirected to /dev/null. If
stdout
is specified and is anOutStream
redirect to stream. If aBuf
is passed, capture output in Buf. Bufs will be flipped and ready to read when this method returns.Stderr is always sent to
Env.cur.err
.