Skip to content

Commit

Permalink
exit 1 on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Gardiner committed Jul 30, 2021
1 parent a436369 commit 5f0aa00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ const {
}
});

AWS.config.credentials.refresh(async (error) => {
AWS.config.credentials.refresh( error => {
if (error) {
console.error(error);
process.exit(1);
} else {
console.log(`AWS_DEFAULT_REGION=${AWS.config.region}; export AWS_DEFAULT_REGION;`);
console.log(`AWS_ACCESS_KEY_ID=${AWS.config.credentials.accessKeyId}; export AWS_ACCESS_KEY_ID;`);
Expand All @@ -54,6 +55,7 @@ const {
},
onFailure: function (err) {
console.error(err.message || JSON.stringify(err));
process.exit(1);
}
});
})();
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cognito-agent",
"version": "1.0.0",
"version": "1.0.1",
"description": "Authenticate with AWS Cognito and retreive credentials to use in your environment",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 5f0aa00

Please sign in to comment.