const classstudsTools::Proc

sys::Obj
  studsTools::Proc

Utilities for running and working with native processes.

abort

Source

static Void abort(Str msg)

Print the msg and exit with error code.

bash

Source

static Int bash(Str bash, Buf? out := null, Bool checked := true)

Convenience for run to evaluate a bash script.

download

Source

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 with msg.

run

Source

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. If checked is false then return the child process error code.

By default, stdout will be redirected to /dev/null. If stdout is specified and is an OutStream redirect to stream. If a Buf 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.