File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/core/src/shared/env Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import { asEnvironmentVariables } from '../../auth/credentials/utils'
2020import { getIAMConnection } from '../../auth/utils'
2121import { ChildProcess } from '../utilities/processUtils'
2222
23- let unixShellEnvPromise : Promise < typeof process . env > | undefined = undefined
23+ let unixShellEnvPromise : Promise < typeof process . env | undefined > | undefined = undefined
2424let envCacheExpireTime : number
2525
2626export interface IProcessEnvironment {
@@ -176,7 +176,7 @@ export async function getResolvedShellEnv(env?: IProcessEnvironment): Promise<ty
176176 if ( ! unixShellEnvPromise || Date . now ( ) > envCacheExpireTime ) {
177177 // cache valid for 5 minutes
178178 envCacheExpireTime = Date . now ( ) + 5 * 60 * 1000
179- unixShellEnvPromise = new Promise < NodeJS . ProcessEnv > ( async ( resolve , reject ) => {
179+ unixShellEnvPromise = new Promise < NodeJS . ProcessEnv | undefined > ( async ( resolve , reject ) => {
180180 const timeout = new Timeout ( 10000 )
181181
182182 // Resolve shell env and handle errors
@@ -185,11 +185,11 @@ export async function getResolvedShellEnv(env?: IProcessEnvironment): Promise<ty
185185 if ( shellEnv && Object . keys ( shellEnv ) . length > 0 ) {
186186 resolve ( shellEnv )
187187 } else {
188- return undefined
188+ resolve ( undefined )
189189 }
190190 } catch {
191191 // failed resolve should not affect other feature.
192- return undefined
192+ resolve ( undefined )
193193 }
194194 } )
195195 }
You can’t perform that action at this time.
0 commit comments