Skip to content

Commit c486388

Browse files
Copilotdmichon-msft
andcommitted
fix: Use existing PackageJsonEditor instead of re-reading file
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
1 parent 9a35a69 commit c486388

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

libraries/rush-lib/src/logic/Autoinstaller.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ export class Autoinstaller {
268268

269269
// Write the last-install.flag file so that a subsequent "rush install-autoinstaller"
270270
// will not perform a redundant install.
271-
await this._createFlagsAsync();
271+
await this._createFlagsAsync(packageJsonEditor.saveToObject());
272272
}
273273

274-
private async _createFlagsAsync(): Promise<void> {
274+
private async _createFlagsAsync(packageJson: IPackageJson): Promise<void> {
275275
const autoinstallerFullPath: string = this.folderFullPath;
276276

277277
// Example: .../common/autoinstallers/my-task/.rush/temp
@@ -281,9 +281,6 @@ export class Autoinstaller {
281281
'temp'
282282
);
283283

284-
const packageJsonPath: string = path.join(autoinstallerFullPath, 'package.json');
285-
const packageJson: IPackageJson = JsonFile.load(packageJsonPath);
286-
287284
const lastInstallFlag: LastInstallFlag = new LastInstallFlag(lastInstallFlagPath, {
288285
node: process.versions.node,
289286
packageManager: this._rushConfiguration.packageManager,

0 commit comments

Comments
 (0)