]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
fix: wrap in quotes if the project name contains spaces (#218)
authorbtea <2356281422@qq.com>
Thu, 23 Feb 2023 13:29:18 +0000 (21:29 +0800)
committerGitHub <noreply@github.com>
Thu, 23 Feb 2023 13:29:18 +0000 (21:29 +0800)
index.ts

index bfd82c71dd060c98e87fffca3a0cefd3ab674236..6f912e1fbd56d2b8e3e0185c41b2a251cef7b333 100755 (executable)
--- a/index.ts
+++ b/index.ts
@@ -446,7 +446,8 @@ async function init() {
 
   console.log(`\nDone. Now run:\n`)
   if (root !== cwd) {
-    console.log(`  ${bold(green(`cd ${path.relative(cwd, root)}`))}`)
+    const cdProjectName = path.relative(cwd, root)
+    console.log(`  ${bold(green(`cd ${cdProjectName.includes(' ') ? `"${cdProjectName}"` : cdProjectName}`))}`)
   }
   console.log(`  ${bold(green(getCommand(packageManager, 'install')))}`)
   if (needsPrettier) {