Files
mtusi2026lab7/scripts/final-source-checks.ts

33 lines
1.0 KiB
TypeScript

import { run, safeFailure, privateWrite, local } from "./runtime";
import { resolve } from "node:path";
let stage = "GO_FORMAT";
try {
await run([
"/home/rey/.local/share/mise/installs/go/1.27.2/bin/gofmt",
"-w",
"scripts/s3-control.go",
]);
stage = "DASHBOARD_GENERATE";
await run([process.execPath, "scripts/telemetry-dashboard.ts"]);
stage = "NATIVE_FORMAT";
await run([process.execPath, "scripts/format-check.ts", "--write"]);
stage = "NONWRITING_SOURCE_CHECKS";
await run([process.execPath, "scripts/validate-source.ts"]);
stage = "EXACT_BINARY_BUILD";
await run([process.execPath, "scripts/preflight-build.ts"]);
console.log("PASS_FINAL_NONWRITING_CHECKS_AND_EXACT_BINARY_BUILD");
} catch (error) {
await Promise.allSettled([
Promise.resolve().then(() =>
privateWrite(
resolve(local, "diagnostics/final-source-check-error.json"),
JSON.stringify({
stage,
message: error instanceof Error ? error.message : "UNKNOWN",
}),
),
),
]);
safeFailure(error);
}