Skip to content

Commit

Permalink
change order for calling methods
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k committed Dec 23, 2024
1 parent 08a9fdd commit 5d7e9e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/aws-cdk/lib/cdk-toolkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,15 +801,15 @@ export class CdkToolkit {
let stacks = await this.selectStacksForDestroy(options.selector, assembly, options.exclusively);

Check warning on line 801 in packages/aws-cdk/lib/cdk-toolkit.ts

View check run for this annotation

Codecov / codecov/patch

packages/aws-cdk/lib/cdk-toolkit.ts#L800-L801

Added lines #L800 - L801 were not covered by tests

await this.suggestStacks(options.selector, assembly, stacks, options.exclusively);

Check warning on line 803 in packages/aws-cdk/lib/cdk-toolkit.ts

View check run for this annotation

Codecov / codecov/patch

packages/aws-cdk/lib/cdk-toolkit.ts#L803

Added line #L803 was not covered by tests
if (stacks.stackArtifacts.length === 0) {
warning(`No stacks match the name(s): ${chalk.red(options.selector.patterns.join(', '))}`);
return;

Check warning on line 806 in packages/aws-cdk/lib/cdk-toolkit.ts

View check run for this annotation

Codecov / codecov/patch

packages/aws-cdk/lib/cdk-toolkit.ts#L805-L806

Added lines #L805 - L806 were not covered by tests
}

// The stacks will have been ordered for deployment, so reverse them for deletion.
stacks = stacks.reversed();

if (!options.force) {
if (stacks.stackArtifacts.length === 0) {
warning(`No stacks match the name(s): ${chalk.red(options.selector.patterns.join(', '))}`);
return;
}
// eslint-disable-next-line max-len
const confirmed = await promptly.confirm(
`Are you sure you want to delete: ${chalk.blue(stacks.stackArtifacts.map((s) => s.hierarchicalId).join(', '))} (y/n)?`,
Expand Down

0 comments on commit 5d7e9e5

Please sign in to comment.