Skip to content

Commit 3d8c86d

Browse files
committed
region fix
1 parent f2c6b6b commit 3d8c86d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/commands/code-binding/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ program
99
.option("-n, --type-name [typeName]", "Type name", "MyType")
1010
.option("-p, --profile [profile]", "AWS profile to use")
1111
.option(
12-
"--region [region]",
12+
"-r, --region [region]",
1313
"The AWS region to use. Falls back on AWS_REGION environment variable if not specified"
1414
)
1515
.option(

src/commands/shared/auth-helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require("@mhlabs/aws-sdk-sso");
33

44
function initAuth(cmd) {
55

6+
AWS.config.region = cmd.region || process.env.AWS_REGION || AWS.config.region
67
const credentials = new AWS.SharedIniFileCredentials({ profile: cmd.profile });
78
if (credentials.accessKeyId) {
89
AWS.config.credentials = credentials;
@@ -12,7 +13,6 @@ function initAuth(cmd) {
1213
new AWS.SingleSignOnCredentials()
1314
);
1415
}
15-
process.env.AWS_REGION = cmd.region || process.env.AWS_REGION || AWS.config.region
1616
}
1717

1818
module.exports = {

0 commit comments

Comments
 (0)