Skip to content

Commit ef5103e

Browse files
committed
Preserve existing comments/whitespace when saving changes to common-versions.json and version-policies.json
1 parent 9041457 commit ef5103e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/rush-lib/src/api/CommonVersionsConfiguration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class CommonVersionsConfiguration {
106106
* Writes the "common-versions.json" file to disk, using the filename that was passed to loadFromFile().
107107
*/
108108
public save(): void {
109-
JsonFile.save(this._serialize(), this._filename);
109+
JsonFile.save(this._serialize(), this._filename, { updateExistingFile: true });
110110
}
111111

112112
/**

‎apps/rush-lib/src/api/VersionPolicyConfiguration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class VersionPolicyConfiguration {
156156
versionPolicyJson.push(versionPolicy._json);
157157
});
158158
if (shouldCommit) {
159-
JsonFile.save(versionPolicyJson, this._jsonFileName);
159+
JsonFile.save(versionPolicyJson, this._jsonFileName, { updateExistingFile: true });
160160
}
161161
}
162162
}

0 commit comments

Comments
 (0)