test(release): strip BOM from Windows smoke config

This commit is contained in:
Peter Steinberger
2026-05-02 00:05:40 +01:00
parent 0c23584c2c
commit 890a053062
2 changed files with 5 additions and 1 deletions

View File

@@ -68,7 +68,10 @@ const fs = require("node:fs");
const path = require("node:path");
const configPath = process.env.OPENCLAW_PARALLELS_AGENT_CONFIG_PATH;
const payload = JSON.parse(process.env.OPENCLAW_PARALLELS_AGENT_CONFIG_PATCH || "{}");
const cfg = fs.existsSync(configPath) ? JSON.parse(fs.readFileSync(configPath, "utf8")) : {};
function readJsonFile(filePath) {
return JSON.parse(fs.readFileSync(filePath, "utf8").replace(/^\\uFEFF/u, ""));
}
const cfg = fs.existsSync(configPath) ? readJsonFile(configPath) : {};
cfg.agents = cfg.agents && typeof cfg.agents === "object" ? cfg.agents : {};
cfg.agents.defaults = cfg.agents.defaults && typeof cfg.agents.defaults === "object" ? cfg.agents.defaults : {};
cfg.agents.defaults.skipBootstrap = true;

View File

@@ -344,6 +344,7 @@ console.log(JSON.stringify(result));
expect(powershell).toContain("config set --batch-file");
expect(powershell).toContain("agents.defaults.skipBootstrap");
expect(powershell).toContain("tools.profile");
expect(powershell).toContain("replace(/^\\\\uFEFF/u");
const npmUpdateScripts = readFileSync(TS_PATHS.npmUpdateScripts, "utf8");
expect(npmUpdateScripts).toContain("posixAgentWorkspaceScript");