Skip to content

Commit

Permalink
fix(core): windows filePaths should be handled in findProjectForPath (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 authored Jun 20, 2023
1 parent 238ad4a commit c46f025
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/nx/src/project-graph/utils/find-project-for-path.ts
Original file line number Diff line number Diff line change
@@ -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>;

Expand Down Expand Up @@ -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);
Expand Down

1 comment on commit c46f025

@vercel
Copy link

@vercel vercel bot commented on c46f025 Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.