Skip to content

Commit

Permalink
fix(misc): ensure workspace directory is normalized correctly (#16855)
Browse files Browse the repository at this point in the history
  • Loading branch information
leosvelperez authored May 8, 2023
1 parent 318b1cf commit cc9e650
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/create-nx-workspace/src/create-empty-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ export async function createEmptyWorkspace<T extends CreateWorkspaceOptions>(
options.packageManager = packageManager;
}

const directory = getFileName(name);
options.name = getFileName(name);
const directory = options.name;

const args = unparse({
...options,
}).join(' ');

const pmc = getPackageManagerCommand(packageManager);

const command = `new ${directory} ${args}`;
const command = `new ${args}`;

const workingDir = process.cwd().replace(/\\/g, '/');
let nxWorkspaceRoot = `"${workingDir}"`;
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace/src/generators/new/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function normalizeOptions(options: Schema): NormalizedSchema {

normalized.name = names(options.name).fileName;
if (!options.directory) {
normalized.directory = options.name;
normalized.directory = normalized.name;
}

const parsed = parsePresetName(options.preset);
Expand Down

1 comment on commit cc9e650

@vercel
Copy link

@vercel vercel bot commented on cc9e650 May 8, 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-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.