@@ -9,29 +9,11 @@ import { slurpFile } from "./slurpFile";
99export const ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE" ;
1010export const ENV_CONFIG_PATH = "AWS_CONFIG_FILE" ;
1111
12- export interface SharedConfigInit {
13- /**
14- * The path at which to locate the ini credentials file. Defaults to the
15- * value of the `AWS_SHARED_CREDENTIALS_FILE` environment variable (if
16- * defined) or `~/.aws/credentials` otherwise.
17- */
18- filepath ?: string ;
19-
20- /**
21- * The path at which to locate the ini config file. Defaults to the value of
22- * the `AWS_CONFIG_FILE` environment variable (if defined) or
23- * `~/.aws/config` otherwise.
24- */
25- configFilepath ?: string ;
26- }
27-
2812const swallowError = ( ) => ( { } ) ;
2913
30- export const loadSharedConfigFiles = async ( init : SharedConfigInit = { } ) : Promise < SharedConfigFiles > => {
31- const {
32- filepath = process . env [ ENV_CREDENTIALS_PATH ] || join ( getHomeDir ( ) , ".aws" , "credentials" ) ,
33- configFilepath = process . env [ ENV_CONFIG_PATH ] || join ( getHomeDir ( ) , ".aws" , "config" ) ,
34- } = init ;
14+ export const loadSharedConfigFiles = async ( ) : Promise < SharedConfigFiles > => {
15+ const filepath = process . env [ ENV_CREDENTIALS_PATH ] || join ( getHomeDir ( ) , ".aws" , "credentials" ) ;
16+ const configFilepath = process . env [ ENV_CONFIG_PATH ] || join ( getHomeDir ( ) , ".aws" , "config" ) ;
3517
3618 const parsedFiles = await Promise . all ( [
3719 slurpFile ( configFilepath ) . then ( parseIni ) . then ( normalizeConfigFile ) . catch ( swallowError ) ,
0 commit comments