Commit 78ca948
authored
absence-scan: run main() on Windows, where the entrypoint guard never matched (#339)
The CLI exits 0 having done nothing on Windows, so the pre-push hook built on
it passes everything — including the bytes the scanner exists to refuse.
`import.meta.url === \`file://${process.argv[1]}\`` compares a URL against a
string built from a native path. On POSIX those coincide. On Windows
import.meta.url is file:///C:/... while process.argv[1] is C:\... with
backslashes, so the template produces file://C:\... and the comparison is never
true. main() is never called.
pathToFileURL is the same helper proxy/pipeline.mjs already uses to turn an
extension path into an import URL.
Measured on Windows at 8ddd4f0, before and after:
node tools/absence-scan.mjs exit 0, no output -> exit 1 + usage
node tools/absence-scan.mjs <file with a UUID> exit 0, no output -> exit 2 + FINDING capture-uuid
node tools/absence-scan.mjs <clean file> exit 0, no output -> exit 0 + "absence-scan: clean"
node --test test/absence-scan.test.mjs 11 pass / 8 fail -> 19 pass / 0 fail
The eight failures are the existing CLI: and git-range: cases. They were
already encoding the correct contract; nothing on Windows was running it.1 parent 02ea227 commit 78ca948
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
467 | 468 | | |
468 | 469 | | |
469 | 470 | | |
470 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
471 | 477 | | |
472 | 478 | | |
473 | 479 | | |
| |||
0 commit comments