MCPcopy Create free account
hub / github.com/angular/dev-infra / getExecOutput

Function getExecOutput

github-actions/saucelabs/set-saucelabs-env.js:20534–20565  ·  view source on GitHub ↗
(commandLine, args, options)

Source from the content-addressed store, hash-verified

20532 });
20533 }
20534 function getExecOutput(commandLine, args, options) {
20535 return __awaiter5(this, void 0, void 0, function* () {
20536 var _a, _b;
20537 let stdout = "";
20538 let stderr = "";
20539 const stdoutDecoder = new import_string_decoder.StringDecoder("utf8");
20540 const stderrDecoder = new import_string_decoder.StringDecoder("utf8");
20541 const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
20542 const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
20543 const stdErrListener = (data) => {
20544 stderr += stderrDecoder.write(data);
20545 if (originalStdErrListener) {
20546 originalStdErrListener(data);
20547 }
20548 };
20549 const stdOutListener = (data) => {
20550 stdout += stdoutDecoder.write(data);
20551 if (originalStdoutListener) {
20552 originalStdoutListener(data);
20553 }
20554 };
20555 const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
20556 const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
20557 stdout += stdoutDecoder.end();
20558 stderr += stderrDecoder.end();
20559 return {
20560 exitCode,
20561 stdout,
20562 stderr
20563 };
20564 });
20565 }
20566
20567 //
20568 var __awaiter6 = function(thisArg, _arguments, P, generator) {

Callers 3

getWindowsInfoFunction · 0.70
getMacOsInfoFunction · 0.70
getLinuxInfoFunction · 0.70

Calls 3

__awaiter5Function · 0.70
execFunction · 0.70
endMethod · 0.45

Tested by

no test coverage detected