Skip to content

Commit

Permalink
fix(core): output paths still use windows separator on linux / mac
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Apr 26, 2021
1 parent fa8f507 commit b729fed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
{
publishCmd: [
'yarn ts-node tools/scripts/publish-all ${nextRelease.version} ${nextRelease.channel}',
],
].join(' && '),
},
],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('nx-dotnet project generator', () => {
expect(outputPath).toBeTruthy();

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const absoluteDistPath = resolve(resolve(config.root, outputPath));
const absoluteDistPath = resolve(config.root, outputPath);
const expectedDistPath = resolve('./dist/test');

expect(absoluteDistPath).toEqual(expectedDistPath);
Expand Down
11 changes: 7 additions & 4 deletions packages/core/src/generators/utils/generate-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,14 @@ function SetOutputPath(
readFileSync(projectFilePath).toString()
);

let outputPath = `${relative(
dirname(projectFilePath),
process.cwd()
)}/dist/${projectName}`;
outputPath = outputPath.replace('\\', '/'); // Forward slash works on windows, backslash does not work on mac/linux

const textNode: Partial<XmlTextNode> = {
text: `${relative(
dirname(projectFilePath),
process.cwd()
)}\\dist\\${projectName}`,
text: outputPath,
type: 'text',
};
textNode.toString = () => textNode.text ?? '';
Expand Down

0 comments on commit b729fed

Please sign in to comment.