mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Fixes project create without creds file
This commit is contained in:
parent
41f1c264e9
commit
84486651e4
@ -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;
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user