fix(core): windows filePaths should be handled in findProjectForPath (#17688)
This commit is contained in:
parent
238ad4aa24
commit
c46f0259af
@ -1,6 +1,7 @@
|
||||
import { dirname } from 'path';
|
||||
import { ProjectGraphProjectNode } from '../../config/project-graph';
|
||||
import { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
||||
import { normalizePath } from '../../utils/path';
|
||||
|
||||
export type ProjectRootMappings = Map<string, string>;
|
||||
|
||||
@ -44,7 +45,12 @@ export function findProjectForPath(
|
||||
filePath: string,
|
||||
projectRootMap: ProjectRootMappings
|
||||
): string | null {
|
||||
let currentPath = filePath;
|
||||
/**
|
||||
* Project Mappings are in UNIX-style file paths
|
||||
* Windows may pass Win-style file paths
|
||||
* Ensure filePath is in UNIX-style
|
||||
*/
|
||||
let currentPath = normalizePath(filePath);
|
||||
for (
|
||||
;
|
||||
currentPath != dirname(currentPath);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user