16 lines
805 B
JavaScript
16 lines
805 B
JavaScript
#!/usr/bin/env node
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
const gate = JSON.parse(fs.readFileSync(path.join(root, "docs/p6/part-module-gate.json"), "utf8"));
|
|
if (gate.taskId !== "FW-P6-PRT-Y" || gate.result !== "pass" || gate.moduleStatusAfterGate !== "completed") {
|
|
throw new Error("Part Y gate is not eligible for module completion");
|
|
}
|
|
const file = path.join(root, "docs/current/task-state.json");
|
|
const state = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
state.module_status.Part = "completed";
|
|
fs.writeFileSync(file, `${JSON.stringify(state, null, 2)}\n`);
|
|
console.log(JSON.stringify({ module: "Part", status: state.module_status.Part, gate: gate.taskId }));
|