Fixes project create without creds file

This commit is contained in:
Jared Short 2015-12-12 15:55:58 -05:00
parent 41f1c264e9
commit 84486651e4

View File

@ -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;
};