Skip to content

Commit 146dd70

Browse files
author
Nick Pape
committed
Other PR Feedback
1 parent a0d8d66 commit 146dd70

2 files changed

Lines changed: 7 additions & 20 deletions

File tree

‎apps/rush-lib/src/cli/utilities/InstallManager.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ export default class InstallManager {
544544
}
545545
}
546546

547-
if (markerFileExistedAndWasValidAtStart) {
547+
if (fsx.existsSync(this.commonNodeModulesMarkerFilename)) {
548548
// Delete the successful install file to indicate the install transaction has started
549549
fsx.unlinkSync(this.commonNodeModulesMarkerFilename);
550550
}
@@ -646,7 +646,10 @@ export default class InstallManager {
646646
this._fixupNpm5Regression();
647647

648648
// Finally, create the marker file to indicate a successful install
649-
fsx.createFileSync(this.commonNodeModulesMarkerFilename);
649+
const lastInstallFlagContents: string =
650+
`${this._rushConfiguration.packageManager}@${this._rushConfiguration.packageManagerToolVersion}`;
651+
652+
fsx.writeFileSync(this.commonNodeModulesMarkerFilename, lastInstallFlagContents);
650653
console.log('');
651654
}
652655

‎apps/rush-lib/src/cli/utilities/pnpm/PnpmLinkManager.ts‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import * as fsx from 'fs-extra';
55
import * as os from 'os';
66
import * as path from 'path';
77
import * as semver from 'semver';
8-
import * as tar from 'tar';
98
import encodeRegistry = require('encode-registry');
109

1110
import { JsonFile } from '@microsoft/node-core-library';
@@ -83,32 +82,17 @@ export default class PnpmLinkManager extends LinkManager {
8382
const extractedFolder: string = path.join(this._rushConfiguration.commonTempFolder,
8483
RushConstants.rushTempProjectsFolderName, unscopedTempProjectName);
8584

86-
// Example: "C:\MyRepo\common\temp\projects\project1.tgz"
87-
const tarballFile: string = path.join(this._rushConfiguration.commonTempFolder,
88-
RushConstants.rushTempProjectsFolderName, unscopedTempProjectName + '.tgz');
89-
9085
// Example: "C:\MyRepo\common\temp\projects\project1\package.json"
91-
const packageJsonFilename: string = path.join(extractedFolder, 'package', 'package.json');
92-
93-
// @todo this code is duplicated
94-
Utilities.createFolderWithRetry(extractedFolder);
95-
tar.extract({
96-
cwd: extractedFolder,
97-
file: tarballFile,
98-
sync: true
99-
});
86+
const packageJsonFilename: string = path.join(extractedFolder, 'package.json');
10087

10188
// Example: "C:\MyRepo\common\temp\node_modules\@rush-temp\project1"
10289
const installFolderName: string = path.join(this._rushConfiguration.commonTempFolder,
10390
RushConstants.nodeModulesFolderName, RushConstants.rushTempNpmScope, unscopedTempProjectName);
10491

10592
const commonPackage: Package = Package.createVirtualTempPackage(packageJsonFilename, installFolderName);
10693

107-
// remove the extracted tarball contents
108-
fsx.removeSync(packageJsonFilename);
109-
fsx.removeSync(extractedFolder);
94+
// @TODO: Validate that the project's package.json still matches the common folder
11095

111-
// TODO: Validate that the project's package.json still matches the common folder
11296
const localPackage: Package = Package.createLinkedPackage(
11397
project.packageJson.name,
11498
commonPackage.version,

0 commit comments

Comments
 (0)