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 { dirname } from 'path';
|
||||||
import { ProjectGraphProjectNode } from '../../config/project-graph';
|
import { ProjectGraphProjectNode } from '../../config/project-graph';
|
||||||
import { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
import { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
||||||
|
import { normalizePath } from '../../utils/path';
|
||||||
|
|
||||||
export type ProjectRootMappings = Map<string, string>;
|
export type ProjectRootMappings = Map<string, string>;
|
||||||
|
|
||||||
@ -44,7 +45,12 @@ export function findProjectForPath(
|
|||||||
filePath: string,
|
filePath: string,
|
||||||
projectRootMap: ProjectRootMappings
|
projectRootMap: ProjectRootMappings
|
||||||
): string | null {
|
): 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 (
|
for (
|
||||||
;
|
;
|
||||||
currentPath != dirname(currentPath);
|
currentPath != dirname(currentPath);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user