fix base stack exists check

pull/289/head
Frostebite 2021-08-10 18:42:48 +01:00
parent f90c906155
commit daf987bcd2
3 changed files with 14 additions and 3 deletions

8
dist/index.js vendored
View File

@ -1031,7 +1031,13 @@ class AWSBuildEnvironment {
const describeStackInput = {
StackName: baseStackName,
};
let CFState = yield CF.describeStacks(describeStackInput).promise();
let CFState;
try {
CFState = yield CF.describeStacks(describeStackInput).promise();
}
catch (_g) {
CFState = { Stacks: [] };
}
const stackExists = CFState.Stacks !== null && CFState.Stacks !== [];
if (stackExists) {
yield CF.createStack({

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -237,7 +237,12 @@ class AWSBuildEnvironment implements RemoteBuilderProviderInterface {
const describeStackInput: SDK.CloudFormation.DescribeStacksInput = {
StackName: baseStackName,
};
let CFState = await CF.describeStacks(describeStackInput).promise();
let CFState;
try {
CFState = await CF.describeStacks(describeStackInput).promise();
} catch {
CFState = { Stacks: [] };
}
const stackExists: Boolean = CFState.Stacks !== null && CFState.Stacks !== [];
if (stackExists) {
await CF.createStack({