MCPcopy Index your code
hub / github.com/dmno-dev/bumpy / runArgsAsync

Function runArgsAsync

packages/bumpy/src/utils/shell.ts:144–164  ·  view source on GitHub ↗
(args: string[], opts?: { cwd?: string; input?: string })

Source from the content-addressed store, hash-verified

142
143/** Async version of runArgs */
144export function runArgsAsync(args: string[], opts?: { cwd?: string; input?: string }): Promise<string> {
145 const result = checkIntercept(args, opts);
146 if (result?.intercepted) {
147 if ('error' in result) return Promise.reject(new Error(result.error));
148 return Promise.resolve(result.result);
149 }
150 const [cmd, ...rest] = args;
151 return new Promise((resolve, reject) => {
152 const child = execFile(cmd!, rest, { cwd: opts?.cwd, encoding: 'utf-8' }, (err, stdout, stderr) => {
153 if (err) {
154 reject(new Error(`Command failed: ${args.join(' ')}\n${stdout}\n${stderr}`.trim()));
155 } else {
156 resolve(stdout.trim());
157 }
158 });
159 if (opts?.input) {
160 child.stdin?.write(opts.input);
161 child.stdin?.end();
162 }
163 });
164}
165
166/** tryRun equivalent for argument arrays */
167export function tryRunArgs(args: string[], opts?: { cwd?: string }): string | null {

Callers 15

shell.test.tsFile · 0.90
createVersionPrFunction · 0.90
createChannelReleasePrFunction · 0.90
enableAutoMergeFunction · 0.90
postOrUpdatePrCommentFunction · 0.90
checkIfPublishedFunction · 0.90
packageExistsOnNpmFunction · 0.90
packThenPublishFunction · 0.90
npmPublishDirectFunction · 0.90
createIndividualReleasesFunction · 0.90
findReleaseByTagFunction · 0.90

Calls 1

checkInterceptFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…