Skip to content

Commit 5b2e2dc

Browse files
author
zengyousen
committed
fix: wrap in quotes if the project name contains spaces
1 parent ee8e7e5 commit 5b2e2dc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ async function init() {
285285
const needsCypressCT = needsCypress && !needsVitest
286286
const needsPlaywright = argv.playwright || needsE2eTesting === 'playwright'
287287

288-
const root = path.join(cwd, targetDir.replace(/\s+/g, '-'))
288+
const root = path.join(cwd, targetDir)
289289

290290
if (fs.existsSync(root) && shouldOverwrite) {
291291
emptyDir(root)
@@ -446,7 +446,8 @@ async function init() {
446446

447447
console.log(`\nDone. Now run:\n`)
448448
if (root !== cwd) {
449-
console.log(` ${bold(green(`cd ${path.relative(cwd, root)}`))}`)
449+
const cdProjectName = path.relative(cwd, root)
450+
console.log(` ${bold(green(`cd ${cdProjectName.includes(' ') ? `"${cdProjectName}"` : cdProjectName}`))}`)
450451
}
451452
console.log(` ${bold(green(getCommand(packageManager, 'install')))}`)
452453
if (needsPrettier) {

0 commit comments

Comments
 (0)