MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / run

Function run

e2e/fixtures/custom-tools-git/generate.ts:8–20  ·  view source on GitHub ↗
(cwd: string, args: readonly string[], stdin?: string)

Source from the content-addressed store, hash-verified

6const fixtureDir = dirname(fileURLToPath(import.meta.url));
7
8const run = (cwd: string, args: readonly string[], stdin?: string): string => {
9 const proc = Bun.spawnSync({
10 cmd: ["git", ...args],
11 cwd,
12 stdin: stdin ? new TextEncoder().encode(stdin) : undefined,
13 });
14 if (!proc.success) {
15 throw new Error(
16 `git ${args.join(" ")} failed\n${proc.stderr.toString()}\n${proc.stdout.toString()}`,
17 );
18 }
19 return proc.stdout.toString().trim();
20};
21
22const write = async (root: string, path: string, body: string) => {
23 await mkdir(dirname(join(root, path)), { recursive: true });

Callers 2

commitFunction · 0.70
generate.tsFile · 0.70

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected