MCPcopy
hub / github.com/vercel/next-forge / run

Function run

scripts/utils.ts:12–36  ·  view source on GitHub ↗
(
  command: string,
  args: string[],
  options?: SpawnSyncOptions
)

Source from the content-addressed store, hash-verified

10export const shellOption = process.platform === "win32";
11
12export const run = (
13 command: string,
14 args: string[],
15 options?: SpawnSyncOptions
16) => {
17 const result = spawnSync(command, args, {
18 stdio: "inherit",
19 shell: shellOption,
20 ...options,
21 });
22
23 if (result.error) {
24 throw result.error;
25 }
26
27 if (result.status !== 0) {
28 const stderr = result.stderr?.toString().trim();
29 const message = stderr
30 ? `Command failed: ${command} ${args.join(" ")}\n${stderr}`
31 : `Command failed with exit code ${result.status}: ${command} ${args.join(" ")}`;
32 throw new Error(message);
33 }
34
35 return result;
36};
37
38export const internalContentDirs = [join(".github", "workflows"), "docs"];
39

Callers 6

cloneRepositoryFunction · 0.85
getFilesFunction · 0.85
getDiffFunction · 0.85
cloneNextForgeFunction · 0.85
initializeGitFunction · 0.85
setupOrmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected