( configPath: string, runtimeFlags: RuntimeFlags )
| 346 | } |
| 347 | |
| 348 | function readKeyringStorageCredentials( |
| 349 | configPath: string, |
| 350 | runtimeFlags: RuntimeFlags |
| 351 | ): Credentials { |
| 352 | const credentials = readCredentialsFromKeyring(configPath, runtimeFlags); |
| 353 | |
| 354 | if (credentials !== null) { |
| 355 | return credentials; |
| 356 | } |
| 357 | |
| 358 | try { |
| 359 | const fileCredentials = readCredentialsFromFile(configPath); |
| 360 | |
| 361 | return migrateCredentialsToKeyring( |
| 362 | configPath, |
| 363 | fileCredentials, |
| 364 | runtimeFlags |
| 365 | ); |
| 366 | } catch (error) { |
| 367 | if (isENOENTError(error)) { |
| 368 | throw createMissingCredentialsError(configPath); |
| 369 | } |
| 370 | |
| 371 | throw error; |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | function readAutoStorageCredentials( |
| 376 | configPath: string, |
no test coverage detected