Skip to content

Commit

Permalink
fix(core): dep-graph with various directory separators
Browse files Browse the repository at this point in the history
MacOS / Linux use different directory separators, and we relied on it being a forward slash.
fixes #43
  • Loading branch information
AgentEnder committed May 18, 2021
1 parent 3037943 commit 3beccb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/generators/utils/generate-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function normalizeOptions(

const npmScope = names(readWorkspaceConfiguration(host).npmScope).className;
const featureScope = projectDirectory
.split('/')
.split(/(\/|\\)/gm)
.map((part) => names(part).className);
const namespaceName = [npmScope, ...featureScope].join('.');

Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/lib/utility-functions/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@nrwl/devkit';

import { readFileSync } from 'fs';
import { isAbsolute, resolve } from 'path';
import { isAbsolute, resolve, dirname } from 'path';
import { XmlDocument, XmlElement } from 'xmldoc';

import { NXDOTNET_TAG } from '../constants';
Expand Down Expand Up @@ -58,7 +58,7 @@ export function getDependantProjectsForNxProject(
absoluteFilePath = includeFilePath;
} else {
absoluteFilePath = resolve(
netProjectFilePath.split('/').slice(0, -1).join('/'),
dirname(netProjectFilePath),
includeFilePath,
);
}
Expand Down

0 comments on commit 3beccb4

Please sign in to comment.