Skip to content

Commit 3a3a9b1

Browse files
committed
fix(material/schematics): avoid overwriting files that didn't change (#31270)
Fixes that the v20 update migration was overwriting all files, even if they didn't change. Fixes #31259. (cherry picked from commit 7b47e95)
1 parent 45fcf24 commit 3a3a9b1

File tree

1 file changed

+3
-1
lines changed
  • src/material/schematics/ng-update

1 file changed

+3
-1
lines changed

src/material/schematics/ng-update/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ function renameMdcTokens(): Rule {
5959
if (shouldRenameTokens(path)) {
6060
const content = tree.readText(path);
6161
const updatedContent = content.replace('--mdc-', '--mat-');
62-
tree.overwrite(path, updatedContent);
62+
if (content !== updatedContent) {
63+
tree.overwrite(path, updatedContent);
64+
}
6365
}
6466
});
6567
};

0 commit comments

Comments
 (0)