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);