MCPcopy
hub / github.com/tobi/qmd / run

Function run

scripts/package-smoke.mjs:10–27  ·  view source on GitHub ↗
(label, command, args, options = {})

Source from the content-addressed store, hash-verified

8const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
9
10function run(label, command, args, options = {}) {
11 console.log(`==> ${label}`);
12 const { quiet, ...spawnOptions } = options;
13 const result = spawnSync(command, args, {
14 cwd: root,
15 stdio: quiet ? "pipe" : "inherit",
16 shell: process.platform === "win32",
17 ...spawnOptions,
18 });
19 if (result.status !== 0) {
20 console.error(`Package smoke failed: ${label}`);
21 if (quiet) {
22 if (result.stdout) process.stderr.write(result.stdout);
23 if (result.stderr) process.stderr.write(result.stderr);
24 }
25 process.exit(result.status ?? 1);
26 }
27}
28
29function assertPath(path, label = path) {
30 const full = join(root, path);

Callers 1

package-smoke.mjsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected