fix(misc): ensure workspace directory is normalized correctly (#16855)

This commit is contained in:
Leosvel Pérez Espinosa 2023-05-08 22:39:36 +01:00 committed by GitHub
parent 318b1cf584
commit cc9e650cd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -32,7 +32,8 @@ 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,
@ -40,7 +41,7 @@ export async function createEmptyWorkspace<T extends CreateWorkspaceOptions>(
const pmc = getPackageManagerCommand(packageManager);
const command = `new ${directory} ${args}`;
const command = `new ${args}`;
const workingDir = process.cwd().replace(/\\/g, '/');
let nxWorkspaceRoot = `"${workingDir}"`;

View File

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