File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed
Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,9 @@ class Job {
158158 '/box/submission' ,
159159 '-E' ,
160160 'HOME=/tmp' ,
161- '-e' ,
161+ ...this . runtime . env_vars . flat_map ( v => [ '-E' , v ] ) ,
162+ '-E' ,
163+ `PISTON_LANGUAGE=${ this . runtime . language } ` ,
162164 `--dir=${ this . runtime . pkgdir } ` ,
163165 `--dir=/etc:noexec` ,
164166 `--processes=${ this . runtime . max_process_count } ` ,
@@ -177,10 +179,6 @@ class Job {
177179 ...args ,
178180 ] ,
179181 {
180- env : {
181- ...this . runtime . env_vars ,
182- PISTON_LANGUAGE : this . runtime . language ,
183- } ,
184182 stdio : 'pipe' ,
185183 }
186184 ) ;
Original file line number Diff line number Diff line change @@ -178,15 +178,7 @@ class Runtime {
178178 const env_file = path . join ( this . pkgdir , '.env' ) ;
179179 const env_content = fss . read_file_sync ( env_file ) . toString ( ) ;
180180
181- this . _env_vars = { } ;
182-
183- env_content
184- . trim ( )
185- . split ( '\n' )
186- . map ( line => line . split ( '=' , 2 ) )
187- . forEach ( ( [ key , val ] ) => {
188- this . _env_vars [ key . trim ( ) ] = val . trim ( ) ;
189- } ) ;
181+ this . _env_vars = env_content . trim ( ) . split ( '\n' ) ;
190182 }
191183
192184 return this . _env_vars ;
You can’t perform that action at this time.
0 commit comments