Fix : windows verify crash 1
Some checks failed
release / build (push) Successful in 24s
release / verify-windows (push) Failing after 1m3s

This commit is contained in:
jeanotx32
2026-08-11 17:25:28 +02:00
parent dc63c2b39d
commit 6f6e829ad5
3 changed files with 18 additions and 6 deletions

View File

@@ -26,7 +26,10 @@ const CONFIG_PATH = path.resolve(
function readFile(): Partial<AgentConfig> {
if (!fs.existsSync(CONFIG_PATH)) return {};
try {
return JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8')) as Partial<AgentConfig>;
// Les éditeurs Windows (et Set-Content -Encoding UTF8) préfixent un BOM que
// JSON.parse rejette.
const raw = fs.readFileSync(CONFIG_PATH, 'utf8').replace(/^\uFEFF/, '');
return JSON.parse(raw) as Partial<AgentConfig>;
} catch (err) {
console.error(`Configuration illisible (${CONFIG_PATH}) :`, err);
return {};