13 lines
762 B
JavaScript
13 lines
762 B
JavaScript
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/surface-module-gate.json"), "utf8"));
|
|
if (gate.taskId !== "FW-P6-SUR-Y" || gate.result !== "passed" || gate.moduleStatus.after !== "completed") throw new Error("Surface gate not eligible");
|
|
const statePath = path.join(root, "docs/current/task-state.json");
|
|
const state = JSON.parse(fs.readFileSync(statePath, "utf8"));
|
|
state.module_status.Surface = "completed";
|
|
fs.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}\n`);
|
|
console.log(JSON.stringify({ module: "Surface", status: state.module_status.Surface }));
|