Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tools/absence-scan.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import { readFileSync } from "node:fs";
import { execFileSync } from "node:child_process";
import { basename } from "node:path";
import { pathToFileURL } from "node:url";

// --- Allowlist ---------------------------------------------------------------
//
Expand Down Expand Up @@ -467,7 +468,12 @@ function main(argv) {
return 0;
}

if (import.meta.url === `file://${process.argv[1]}`) {
// Entrypoint guard. pathToFileURL, NOT `file://${argv[1]}`: on Windows
// import.meta.url is file:///C:/... while argv[1] is C:\... with backslashes,
// so the template form never matches and main() never runs — the CLI becomes a
// silent exit-0 no-op, and the pre-push hook that depends on it passes
// everything. Same helper proxy/pipeline.mjs already uses for its loader.
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
let code;
try {
code = main(process.argv);
Expand Down
Loading