From 84486651e4c2ea34e25fe5bb8dc1a95b37bc29ea Mon Sep 17 00:00:00 2001 From: Jared Short Date: Sat, 12 Dec 2015 15:55:58 -0500 Subject: [PATCH] Fixes project create without creds file --- lib/utils/aws/Misc.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/utils/aws/Misc.js b/lib/utils/aws/Misc.js index 9fd096ee8..681f4373d 100644 --- a/lib/utils/aws/Misc.js +++ b/lib/utils/aws/Misc.js @@ -48,7 +48,14 @@ module.exports.getConfigDir = function() { module.exports.profilesMap = function() { let credsPath = path.join(this.getConfigDir(), 'credentials'); - return AWS.util.ini.parse(AWS.util.readFileSync(credsPath)); + + try { + return AWS.util.ini.parse(AWS.util.readFileSync(credsPath)); + } + catch (e) { + return []; + } + }; /** @@ -62,6 +69,7 @@ module.exports.profilesGet = function(awsProfile) { if (!profiles[awsProfile]) { throw new SError(`Cant find profile ${awsProfile} in ~/.aws/credentials`, awsProfile); } + return profiles; };