Function build_data::exec[][src]

pub fn exec(cmd: impl AsRef<OsStr>, args: &[&str]) -> Result<String, String>

Executes cmd with args as parameters, waits for it to exit, and returns its stdout, trimmed, and escaped with escape_ascii.

Errors

Returns a descriptive error string if it fails to execute the command or if the command exits with a non-zero status.

Panics

Panics if the process writes non-UTF bytes to stdout.