Skip to content

Commit

Permalink
Fix #597: parse error during diff
Browse files Browse the repository at this point in the history
  • Loading branch information
k7k0 authored and erwaxler committed Oct 16, 2024
1 parent 27bd201 commit ec2b755
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/packages/@aws-accelerator/utils/lib/diff-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export function printStackDiff(
// detect and filter out mangled characters from the diff
let filteredChangesCount = 0;
if (diff.differenceCount && !strict) {
const mangledNewTemplate = JSON.parse(mangleLikeCloudFormation(JSON.stringify(newTemplate)));
const mangledDiff = fullDiff(oldTemplate, mangledNewTemplate, changeSet);
const mangledNewTemplate = JSON.parse(mangleLikeCloudFormation(JSON.stringify(readTemplate(newTemplate))));
const mangledDiff = fullDiff(readTemplate(oldTemplate), mangledNewTemplate, changeSet);
filteredChangesCount = Math.max(0, diff.differenceCount - mangledDiff.differenceCount);
if (filteredChangesCount > 0) {
diff = mangledDiff;
Expand Down

0 comments on commit ec2b755

Please sign in to comment.