Files
moltbot/scripts/generate-base-config-schema.ts
Fusion future 66c47a9aa3 fix: use pathToFileURL for Windows path comparison in generate-base-config-schema
Summary:
- Use Node's pathToFileURL for the base-config schema generator entrypoint guard so Windows backslash paths are recognized correctly.
- Keep the schema generation logic unchanged and preserve the current changelog attribution.

Verification:
- node --import tsx scripts/generate-base-config-schema.ts --check
- pnpm build
- pnpm check
- GitHub CI passed, including Real behavior proof, auto-response, ClawSweeper dispatch, and full repository checks.

Co-authored-by: Fusion future <23738961+easyteacher@users.noreply.github.com>
2026-05-11 00:09:35 -05:00

24 lines
714 B
JavaScript

#!/usr/bin/env node
import { pathToFileURL } from "node:url";
import { computeBaseConfigSchemaResponse } from "../src/config/schema-base.js";
export function checkBaseConfigSchema(): void {
computeBaseConfigSchemaResponse({
generatedAt: "2026-05-05T00:00:00.000Z",
});
}
const args = new Set(process.argv.slice(2));
if (args.has("--check") && args.has("--write")) {
throw new Error("Use either --check or --write, not both.");
}
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
checkBaseConfigSchema();
if (args.has("--write")) {
console.log("[base-config-schema] runtime-computed; no generated file to write");
} else {
console.log("[base-config-schema] ok");
}
}