File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
apps/vscode-e2e/src/suite Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,17 @@ export async function run() {
2626 for ( const rawLine of content . split ( "\n" ) ) {
2727 const line = rawLine . trim ( )
2828 if ( ! line || line . startsWith ( "#" ) ) continue
29- const match = line . match ( / ^ \s * ( [ A - Z a - z _ ] [ A - Z a - z 0 - 9 _ ] * ) \s * = \s * ( .* ) \s * $ / )
30- if ( ! match ) continue
31- const key = match [ 1 ]
32- let val = match [ 2 ]
29+ const m = / ^ \s * ( [ A - Z a - z _ ] [ A - Z a - z 0 - 9 _ ] * ) \s * = \s * ( .* ) \s * $ / . exec ( line )
30+ if ( ! m ) continue
31+ const key : string = m [ 1 ] ?? ""
32+ let val : string = m [ 2 ] ?? ""
3333 // Strip surrounding quotes if present
3434 if ( ( val . startsWith ( '"' ) && val . endsWith ( '"' ) ) || ( val . startsWith ( "'" ) && val . endsWith ( "'" ) ) ) {
3535 val = val . slice ( 1 , - 1 )
3636 }
37- if ( ! process . env [ key ] ) process . env [ key ] = val
37+ if ( key && ! ( key in process . env ) ) {
38+ ; ( process . env as Record < string , string > ) [ key ] = val
39+ }
3840 }
3941 } catch {
4042 // ignore env load errors; tests may still pass without API calls
You can’t perform that action at this time.
0 commit comments