Skip to content

Commit 10e03f7

Browse files
committed
fix: isolate crestodian first run env
1 parent f0f5da0 commit 10e03f7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

scripts/e2e/crestodian-first-run-docker-client.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ function assert(condition: unknown, message: string): asserts condition {
3838
}
3939
}
4040

41+
function setEnvValue(key: string, value: string): void {
42+
Reflect.set(process.env, key, value);
43+
}
44+
4145
function createRuntime(): { runtime: RuntimeEnv; lines: string[] } {
4246
const lines: string[] = [];
4347
return {
@@ -71,8 +75,8 @@ async function main() {
7175
tempState.registerExitCleanup();
7276
const stateDir = tempState.stateDir;
7377
const configPath = process.env.OPENCLAW_CONFIG_PATH ?? path.join(stateDir, "openclaw.json");
74-
process.env.OPENCLAW_STATE_DIR = stateDir;
75-
process.env.OPENCLAW_CONFIG_PATH = configPath;
78+
setEnvValue("OPENCLAW_STATE_DIR", stateDir);
79+
setEnvValue("OPENCLAW_CONFIG_PATH", configPath);
7680
await fs.rm(stateDir, { recursive: true, force: true });
7781
await fs.mkdir(stateDir, { recursive: true });
7882
clearConfigCache();
@@ -104,7 +108,7 @@ async function main() {
104108
"fresh overview did not include setup recommendation",
105109
);
106110

107-
process.env[spec.discordEnv] = spec.discordToken;
111+
setEnvValue(spec.discordEnv, spec.discordToken);
108112

109113
const commandVars = {
110114
defaultWorkspace: spec.dockerDefaultWorkspace,

0 commit comments

Comments
 (0)