MCPcopy Create free account
hub / github.com/ampproject/amphtml / execWithError

Function execWithError

build-system/common/exec.js:59–65  ·  view source on GitHub ↗

* Executes the provided command, piping the parent process' stderr, updating * the error to process if stderr is not empty, and returns process object. * @param {string} cmd * @return {!Object}

(cmd)

Source from the content-addressed store, hash-verified

57 * @return {!Object}
58 */
59function execWithError(cmd) {
60 const p = exec(cmd, {'stdio': ['inherit', 'inherit', 'pipe']});
61 if (p.stderr.length > 0) {
62 p.error = new Error(p.stderr.toString());
63 }
64 return p;
65}
66
67/**
68 * Executes the provided command, piping the parent process' stderr, throwing

Callers

nothing calls this directly

Calls 2

execFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected