




















@@ -38,6 +38,10 @@ function assert(condition: unknown, message: string): asserts condition {
3838}
3939}
404041+function setEnvValue(key: string, value: string): void {
42+Reflect.set(process.env, key, value);
43+}
44+4145function createRuntime(): { runtime: RuntimeEnv; lines: string[] } {
4246const lines: string[] = [];
4347return {
@@ -71,8 +75,8 @@ async function main() {
7175tempState.registerExitCleanup();
7276const stateDir = tempState.stateDir;
7377const 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);
7680await fs.rm(stateDir, { recursive: true, force: true });
7781await fs.mkdir(stateDir, { recursive: true });
7882clearConfigCache();
@@ -104,7 +108,7 @@ async function main() {
104108"fresh overview did not include setup recommendation",
105109);
106110107-process.env[spec.discordEnv] = spec.discordToken;
111+setEnvValue(spec.discordEnv, spec.discordToken);
108112109113const commandVars = {
110114defaultWorkspace: spec.dockerDefaultWorkspace,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。