24 lines
755 B
JavaScript
24 lines
755 B
JavaScript
import { spawnSync } from "node:child_process";
|
|
import path from "node:path";
|
|
import { repositoryRoot } from "./repository-files.mjs";
|
|
|
|
const scripts = ["prototype/app.js", "prototype/capture.mjs"];
|
|
const failures = [];
|
|
|
|
for (const script of scripts) {
|
|
const result = spawnSync(process.execPath, ["--check", path.join(repositoryRoot, script)], {
|
|
encoding: "utf8",
|
|
});
|
|
if (result.status !== 0) {
|
|
failures.push(`${script}: ${(result.stderr || result.stdout).trim()}`);
|
|
}
|
|
}
|
|
|
|
if (failures.length > 0) {
|
|
console.error("Prototype syntax verification failed:");
|
|
for (const failure of failures) console.error(`- ${failure}`);
|
|
process.exitCode = 1;
|
|
} else {
|
|
console.log(`Prototype syntax verification passed (${scripts.length} files).`);
|
|
}
|