8000 [rush] Fix path parsing issue when running rush bridge-package (#5224) · lwsinclair/rushstack@bd14afe · GitHub
[go: up one dir, main page]

Skip to content

Commit bd14afe

Browse files
authored
[rush] Fix path parsing issue when running rush bridge-package (microsoft#5224)
* fix: parse path * fix: ci
1 parent 3da3c61 commit bd14afe

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "Fix path parsing issue when running rush bridge-package",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}

libraries/rush-lib/src/utilities/HotlinkManager.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ import {
1313
type INodePackageJson,
1414
type IPackageJsonDependencyTable
1515
} from '@rushstack/node-core-library';
16-
import type { DependencyPath } from '@pnpm/dependency-path';
1716
import { PackageExtractor } from '@rushstack/package-extractor';
1817
import { pnpmSyncUpdateFileAsync, pnpmSyncCopyAsync, type ILogMessageCallbackOptions } from 'pnpm-sync-lib';
19-
import { parse } from '@pnpm/dependency-path';
2018
import * as semver from 'semver';
2119

2220
import type { RushConfiguration } from '../api/RushConfiguration';
@@ -196,9 +194,8 @@ export class HotlinkManager {
196194
);
197195
const packageSourcePathSet: Set<string> = new Set();
198196
for (const dirName of subDirectories) {
199-
const parsedDependency: DependencyPath = parse(dirName);
200-
if (parsedDependency?.name === packageName) {
201-
const packageSourcePath: string = `${consumerPackagePnpmDependenciesFolderPath}/${dirName}/${RushConstants.nodeModulesFolderName}/${packageName}`;
197+
const packageSourcePath: string = `${consumerPackagePnpmDependenciesFolderPath}/${dirName}/${RushConstants.nodeModulesFolderName}/${packageName}`;
198+
if (await FileSystem.existsAsync(packageSourcePath)) {
202199
const { version } = await JsonFile.loadAsync(`${packageSourcePath}/${FileConstants.PackageJson}`);
203200
if (semver.satisfies(version, versionRange)) {
204201
packageSourcePathSet.add(packageSourcePath);

0 commit comments

Comments
 (0)
0