@@ -56702,49 +56702,6 @@ var ChildProcess = class {
5670256702 childProcess.on("close", (status) => status === 0 ? resolve() : reject(status));
5670356703 });
5670456704 }
56705- static spawn(command, args, options = {}) {
56706- return new Promise((resolve, reject) => {
56707- const commandText = `${command} ${args.join(" ")}`;
56708- const outputMode = options.mode;
56709- const env3 = getEnvironmentForNonInteractiveCommand(options.env);
56710- Log.debug(`Executing command: ${commandText}`);
56711- const childProcess = _spawn(command, args, { ...options, env: env3, shell: true, stdio: "pipe" });
56712- let logOutput = "";
56713- let stdout = "";
56714- let stderr = "";
56715- if (options.input !== void 0) {
56716- childProcess.stdin.write(options.input);
56717- childProcess.stdin.end();
56718- }
56719- childProcess.stderr.on("data", (message) => {
56720- stderr += message;
56721- logOutput += message;
56722- if (outputMode === void 0 || outputMode === "enabled") {
56723- process.stderr.write(message);
56724- }
56725- });
56726- childProcess.stdout.on("data", (message) => {
56727- stdout += message;
56728- logOutput += message;
56729- if (outputMode === void 0 || outputMode === "enabled") {
56730- process.stderr.write(message);
56731- }
56732- });
56733- childProcess.on("close", (exitCode, signal) => {
56734- const exitDescription = exitCode !== null ? `exit code "${exitCode}"` : `signal "${signal}"`;
56735- const printFn = outputMode === "on-error" ? Log.error : Log.debug;
56736- const status = statusFromExitCodeAndSignal(exitCode, signal);
56737- printFn(`Command "${commandText}" completed with ${exitDescription}.`);
56738- printFn(`Process output:
56739- ${logOutput}`);
56740- if (status === 0 || options.suppressErrorOnFailingExitCode) {
56741- resolve({ stdout, stderr, status });
56742- } else {
56743- reject(outputMode === "silent" ? logOutput : void 0);
56744- }
56745- });
56746- });
56747- }
5674856705 static spawnSync(command, args, options = {}) {
5674956706 const commandText = `${command} ${args.join(" ")}`;
5675056707 const env3 = getEnvironmentForNonInteractiveCommand(options.env);
@@ -56756,44 +56713,14 @@ ${logOutput}`);
5675656713 }
5675756714 throw new Error(stderr);
5675856715 }
56716+ static spawn(command, args, options = {}) {
56717+ const commandText = `${command} ${args.join(" ")}`;
56718+ const env3 = getEnvironmentForNonInteractiveCommand(options.env);
56719+ return processAsyncCmd(commandText, options, _spawn(command, args, { ...options, env: env3, shell: true, stdio: "pipe" }));
56720+ }
5675956721 static exec(command, options = {}) {
56760- return new Promise((resolve, reject) => {
56761- var _a2, _b;
56762- const outputMode = options.mode;
56763- const env3 = getEnvironmentForNonInteractiveCommand(options.env);
56764- Log.debug(`Executing command: ${command}`);
56765- const childProcess = _exec(command, { ...options, env: env3 });
56766- let logOutput = "";
56767- let stdout = "";
56768- let stderr = "";
56769- (_a2 = childProcess.stderr) == null ? void 0 : _a2.on("data", (message) => {
56770- stderr += message;
56771- logOutput += message;
56772- if (outputMode === void 0 || outputMode === "enabled") {
56773- process.stderr.write(message);
56774- }
56775- });
56776- (_b = childProcess.stdout) == null ? void 0 : _b.on("data", (message) => {
56777- stdout += message;
56778- logOutput += message;
56779- if (outputMode === void 0 || outputMode === "enabled") {
56780- process.stderr.write(message);
56781- }
56782- });
56783- childProcess.on("close", (exitCode, signal) => {
56784- const exitDescription = exitCode !== null ? `exit code "${exitCode}"` : `signal "${signal}"`;
56785- const printFn = outputMode === "on-error" ? Log.error : Log.debug;
56786- const status = statusFromExitCodeAndSignal(exitCode, signal);
56787- printFn(`Command "${command}" completed with ${exitDescription}.`);
56788- printFn(`Process output:
56789- ${logOutput}`);
56790- if (status === 0 || options.suppressErrorOnFailingExitCode) {
56791- resolve({ stdout, stderr, status });
56792- } else {
56793- reject(outputMode === "silent" ? logOutput : void 0);
56794- }
56795- });
56796- });
56722+ const env3 = getEnvironmentForNonInteractiveCommand(options.env);
56723+ return processAsyncCmd(command, options, _exec(command, { ...options, env: env3 }));
5679756724 }
5679856725};
5679956726function statusFromExitCodeAndSignal(exitCode, signal) {
@@ -56803,6 +56730,42 @@ function getEnvironmentForNonInteractiveCommand(userProvidedEnv) {
5680356730 const forceColorValue = supports_color_default2.stdout !== false ? supports_color_default2.stdout.level.toString() : void 0;
5680456731 return { FORCE_COLOR: forceColorValue, ...userProvidedEnv ?? process.env };
5680556732}
56733+ function processAsyncCmd(command, options, childProcess) {
56734+ return new Promise((resolve, reject) => {
56735+ var _a2, _b;
56736+ let logOutput = "";
56737+ let stdout = "";
56738+ let stderr = "";
56739+ Log.debug(`Executing command: ${command}`);
56740+ (_a2 = childProcess.stderr) == null ? void 0 : _a2.on("data", (message) => {
56741+ stderr += message;
56742+ logOutput += message;
56743+ if (options.mode === void 0 || options.mode === "enabled") {
56744+ process.stderr.write(message);
56745+ }
56746+ });
56747+ (_b = childProcess.stdout) == null ? void 0 : _b.on("data", (message) => {
56748+ stdout += message;
56749+ logOutput += message;
56750+ if (options.mode === void 0 || options.mode === "enabled") {
56751+ process.stderr.write(message);
56752+ }
56753+ });
56754+ childProcess.on("close", (exitCode, signal) => {
56755+ const exitDescription = exitCode !== null ? `exit code "${exitCode}"` : `signal "${signal}"`;
56756+ const printFn = options.mode === "on-error" ? Log.error : Log.debug;
56757+ const status = statusFromExitCodeAndSignal(exitCode, signal);
56758+ printFn(`Command "${command}" completed with ${exitDescription}.`);
56759+ printFn(`Process output:
56760+ ${logOutput}`);
56761+ if (status === 0 || options.suppressErrorOnFailingExitCode) {
56762+ resolve({ stdout, stderr, status });
56763+ } else {
56764+ reject(options.mode === "silent" ? logOutput : void 0);
56765+ }
56766+ });
56767+ });
56768+ }
5680656769
5680756770//
5680856771function determineRepoBaseDirFromCwd() {
0 commit comments