Skip to content

Commit ed71358

Browse files
committed
Get rid of some path.joins
1 parent d98231e commit ed71358

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -475,14 +475,10 @@ export class WorkspaceInstallManager extends BaseInstallManager {
475475
// Also consider timestamps for all the project node_modules folders, as well as the package.json
476476
// files
477477
// Example: [ "C:\MyRepo\projects\projectA\node_modules", "C:\MyRepo\projects\projectA\package.json" ]
478-
potentiallyChangedFiles.push(
479-
...subspace.getProjects().map((project) => {
480-
return path.join(project.projectFolder, RushConstants.nodeModulesFolderName);
481-
}),
482-
...subspace.getProjects().map((project) => {
483-
return path.join(project.projectFolder, FileConstants.PackageJson);
484-
})
485-
);
478+
for (const { projectFolder } of subspace.getProjects()) {
479+
potentiallyChangedFiles.push(`${projectFolder}/${RushConstants.nodeModulesFolderName}`);
480+
potentiallyChangedFiles.push(`${projectFolder}/${FileConstants.PackageJson}`);
481+
}
486482

487483
// NOTE: If any of the potentiallyChangedFiles does not exist, then isFileTimestampCurrent()
488484
// returns false.
@@ -504,10 +500,7 @@ export class WorkspaceInstallManager extends BaseInstallManager {
504500
packageManagerEnv.FORCE_COLOR = '1';
505501
}
506502

507-
const commonNodeModulesFolder: string = path.join(
508-
subspace.getSubspaceTempFolderPath(),
509-
RushConstants.nodeModulesFolderName
510-
);
503+
const commonNodeModulesFolder: string = `${subspace.getSubspaceTempFolderPath()}/${RushConstants.nodeModulesFolderName}`;
511504

512505
// Is there an existing "node_modules" folder to consider?
513506
if (FileSystem.exists(commonNodeModulesFolder)) {
@@ -656,9 +649,9 @@ export class WorkspaceInstallManager extends BaseInstallManager {
656649
// Ensure that node_modules folders exist after install, since the timestamps on these folders are used
657650
// to determine if the install can be skipped
658651
const projectNodeModulesFolders: string[] = [
659-
path.join(subspace.getSubspaceTempFolderPath(), RushConstants.nodeModulesFolderName),
652+
`${subspace.getSubspaceTempFolderPath()}/${RushConstants.nodeModulesFolderName}`,
660653
...this.rushConfiguration.projects.map((project) => {
661-
return path.join(project.projectFolder, RushConstants.nodeModulesFolderName);
654+
return `${project.projectFolder}/${RushConstants.nodeModulesFolderName}`;
662655
})
663656
];
664657

0 commit comments

Comments
 (0)