Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(web): run preflight on Windows

Gusc00390d9ee55
diff --git a/src/web/scripts/preflight-bug-reports.test.ts b/src/web/scripts/preflight-bug-reports.test.ts
index e07c05552..8fd28254c 100644
--- a/src/web/scripts/preflight-bug-reports.test.ts
+++ b/src/web/scripts/preflight-bug-reports.test.ts
@@ -69,7 +69,7 @@ describe("B2d read-only bug-report R2 preflight", () => {
const secretMarker = "PREFLIGHT_SECRET_MUST_NOT_LEAK";
const packageManagerCli = process.env.npm_execpath;
if (!packageManagerCli) throw new Error("npm_execpath is required to invoke the package CLI");
- const child = spawnSync(process.execPath, [packageManagerCli, "preflight:bug-reports"], {
+ const child = spawnSync(process.execPath, [packageManagerCli, "run", "preflight:bug-reports"], {
cwd: packageRoot,
encoding: "utf8",
env: {
diff --git a/src/web/scripts/preflight-bug-reports.ts b/src/web/scripts/preflight-bug-reports.ts
index c3685a4fb..98a418e20 100644
--- a/src/web/scripts/preflight-bug-reports.ts
+++ b/src/web/scripts/preflight-bug-reports.ts
@@ -1,3 +1,5 @@
+import { pathToFileURL } from "node:url";
+
interface CloudflareEnvelope {
success?: unknown;
result?: unknown;
@@ -100,7 +102,8 @@ async function main(): Promise<void> {
if (!result.ok) process.exitCode = 1;
}
-if (import.meta.url === `file://${process.argv[1]}`) {
+const invokedPath = process.argv[1];
+if (invokedPath && import.meta.url === pathToFileURL(invokedPath).href) {
void main().catch(() => {
process.stderr.write("bug-report R2 preflight failed closed\n");
process.stdout.write(`${JSON.stringify({ ok: false, checks: failedChecks() })}\n`);