Skip to content

Commit

Permalink
fix(cdk): Print names for changed stacks when using --quiet
Browse files Browse the repository at this point in the history
  • Loading branch information
nomike committed Jan 24, 2024
1 parent df8fbc4 commit 1b7a9ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/aws-cdk/lib/cdk-toolkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ export class CdkToolkit {
} else {
// Compare N stacks against deployed templates
for (const stack of stacks.stackArtifacts) {
if (!quiet) {
stream.write(format('Stack %s\n', chalk.bold(stack.displayName)));
}

const templateWithNames = await this.props.deployments.readCurrentTemplateWithNestedStacks(
stack, options.compareAgainstProcessedTemplate,
);
Expand Down
5 changes: 5 additions & 0 deletions packages/aws-cdk/lib/diff.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { format } from 'util';
import * as cxschema from '@aws-cdk/cloud-assembly-schema';
import * as cfnDiff from '@aws-cdk/cloudformation-diff';
import * as cxapi from '@aws-cdk/cx-api';
Expand Down Expand Up @@ -49,6 +50,10 @@ export function printStackDiff(
}

if (!diff.isEmpty) {
if (!quiet && stream) {
stream.write(format('Stack %s\n', chalk.bold(newTemplate.displayName)));
}

cfnDiff.formatDifferences(stream || process.stderr, diff, {
...logicalIdMapFromTemplate(oldTemplate),
...buildLogicalToPathMap(newTemplate),
Expand Down

0 comments on commit 1b7a9ed

Please sign in to comment.