File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
packages/workspace/src/utilities Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { joinPathFragments } from '@nrwl/devkit' ;
2
+ import { appRootPath } from '@nrwl/tao/src/utils/app-root' ;
2
3
import { relative , resolve } from 'path' ;
3
4
import { readCachedProjectGraph } from '../core/project-graph' ;
4
- import { appRootPath } from './app-root' ;
5
5
import {
6
6
getProjectNameFromDirPath ,
7
7
getSourceDirOfDependentProjects ,
Original file line number Diff line number Diff line change 1
- import type { ProjectGraph , ProjectGraphNode } from '@nrwl/devkit' ;
1
+ import { normalizePath , ProjectGraph , ProjectGraphNode } from '@nrwl/devkit' ;
2
2
import { relative } from 'path' ;
3
3
import { readCachedProjectGraph } from '../core/project-graph' ;
4
4
@@ -45,10 +45,13 @@ export function getProjectNameFromDirPath(
45
45
) {
46
46
let parentNodeName = null ;
47
47
for ( const [ nodeName , node ] of Object . entries ( projectGraph . nodes ) ) {
48
- const relativePath = relative ( node . data . root , projRelativeDirPath ) ;
48
+ const normalizedRootPath = normalizePath ( node . data . root ) ;
49
+ const normalizedProjRelPath = normalizePath ( projRelativeDirPath ) ;
50
+
51
+ const relativePath = relative ( normalizedRootPath , normalizedProjRelPath ) ;
49
52
const isMatch = relativePath && ! relativePath . startsWith ( '..' ) ;
50
53
51
- if ( isMatch || node . data . root === projRelativeDirPath ) {
54
+ if ( isMatch || normalizedRootPath === normalizedProjRelPath ) {
52
55
parentNodeName = nodeName ;
53
56
break ;
54
57
}
You can’t perform that action at this time.
0 commit comments