@@ -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+
4145function 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