// C2-14 (#1728): the shell's check that no fixture credential reached the driver's output. // The values come from fixture-credentials.mjs, the one place they are defined, and are never // printed. Exit 0: none of the files holds one. Exit 1: one does. Exit 2: no file given, or a // file could not be read, so nothing was checked. import { readFileSync } from 'node:fs'; import { FIXTURE_CREDENTIALS } from './fixture-credentials.mjs'; const files = process.argv.slice(2); if (!files.length || !FIXTURE_CREDENTIALS.length) process.exit(2); let found = false; for (const file of files) { let bytes; try { bytes = readFileSync(file); } catch { process.exit(2); } if (FIXTURE_CREDENTIALS.some(value => bytes.includes(value))) found = true; } process.exit(found ? 1 : 0);