From 8712d230471cbe3b2ca37f6375b2e924253be4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Mon, 8 May 2023 11:19:15 +0100 Subject: [PATCH] fix(misc): ensure workspace directory is normalized correctly --- packages/create-nx-workspace/src/create-empty-workspace.ts | 5 +++-- packages/workspace/src/generators/new/new.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/create-nx-workspace/src/create-empty-workspace.ts b/packages/create-nx-workspace/src/create-empty-workspace.ts index 2e91ef7470edd..168815b9bc800 100644 --- a/packages/create-nx-workspace/src/create-empty-workspace.ts +++ b/packages/create-nx-workspace/src/create-empty-workspace.ts @@ -32,7 +32,8 @@ export async function createEmptyWorkspace( options.packageManager = packageManager; } - const directory = getFileName(name); + options.name = getFileName(name); + const directory = options.name; const args = unparse({ ...options, @@ -40,7 +41,7 @@ export async function createEmptyWorkspace( const pmc = getPackageManagerCommand(packageManager); - const command = `new ${directory} ${args}`; + const command = `new ${args}`; const workingDir = process.cwd().replace(/\\/g, '/'); let nxWorkspaceRoot = `"${workingDir}"`; diff --git a/packages/workspace/src/generators/new/new.ts b/packages/workspace/src/generators/new/new.ts index 9c83395d3a5e7..9fdba08932b3c 100644 --- a/packages/workspace/src/generators/new/new.ts +++ b/packages/workspace/src/generators/new/new.ts @@ -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);