File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,9 +16,18 @@ export async function spawnCoana(
1616 extra ?: SpawnExtra | undefined ,
1717) : Promise < CResult < unknown > > {
1818 const { env : spawnEnv } = { __proto__ : null , ...options } as SpawnOptions
19+ const mixinsEnv : Record < string , string > = {
20+ // Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION.
21+ SOCKET_CLI_VERSION : constants . ENV . INLINED_SOCKET_CLI_VERSION ,
22+ }
23+ const defaultApiToken = getDefaultToken ( )
24+ if ( defaultApiToken ) {
25+ mixinsEnv [ 'SOCKET_CLI_API_TOKEN' ] = defaultApiToken
26+ }
1927 const orgSlugCResult = await getDefaultOrgSlug ( )
20- const SOCKET_ORG_SLUG = orgSlugCResult . ok ? orgSlugCResult . data : undefined
21- const SOCKET_CLI_API_TOKEN = getDefaultToken ( )
28+ if ( orgSlugCResult . ok ) {
29+ mixinsEnv [ 'SOCKET_ORG_SLUG' ] = orgSlugCResult . data
30+ }
2231 try {
2332 const output = await spawn (
2433 constants . execPath ,
@@ -37,8 +46,7 @@ export async function spawnCoana(
3746 ...process . env ,
3847 // Lazily access constants.processEnv.
3948 ...constants . processEnv ,
40- SOCKET_CLI_API_TOKEN ,
41- SOCKET_ORG_SLUG ,
49+ ...mixinsEnv ,
4250 ...spawnEnv ,
4351 } ,
4452 } ,
You can’t perform that action at this time.
0 commit comments