MCPcopy Index your code
hub / github.com/changesets/changesets / execWithOutput

Function execWithOutput

packages/release-utils/src/utils.ts:91–115  ·  view source on GitHub ↗
(
  command: string,
  args: string[],
  options: { ignoreReturnCode?: boolean; cwd: string }
)

Source from the content-addressed store, hash-verified

89}
90
91export async function execWithOutput(
92 command: string,
93 args: string[],
94 options: { ignoreReturnCode?: boolean; cwd: string }
95) {
96 process.stdout.write(`Running: ${command} ${args.join(" ")}` + os.EOL);
97 let childProcess = spawn(command, args, {
98 cwd: options.cwd,
99 });
100 childProcess.on("stdout", (data) => process.stdout.write(data));
101 childProcess.on("stderr", (data) => process.stderr.write(data));
102 let result = await childProcess;
103 if (!options?.ignoreReturnCode && result.code !== 0) {
104 throw new Error(
105 `The command "${command} ${args.join(" ")}" failed with code ${
106 result.code
107 }\n${result.stdout.toString("utf8")}\n${result.stderr.toString("utf8")}`
108 );
109 }
110 return {
111 code: result.code,
112 stdout: result.stdout.toString("utf8"),
113 stderr: result.stderr.toString("utf8"),
114 };
115}
116
117export function sortChangelogEntries(
118 a: { private: boolean; highestLevel: number },

Callers 9

runPublishFunction · 0.90
runVersionFunction · 0.90
getCurrentBranchFunction · 0.90
pullBranchFunction · 0.90
pushFunction · 0.90
resetFunction · 0.90
commitAllFunction · 0.90
checkIfCleanFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected