]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
fix: targetDir should be inferred from positionals instead of args
authorHaoqun Jiang <haoqunjiang@gmail.com>
Mon, 11 Mar 2024 14:27:49 +0000 (22:27 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Mon, 11 Mar 2024 14:29:04 +0000 (22:29 +0800)
Fixes #464

index.ts

index 03ee00c5d5e307613b6ee024ae09c6626de66b82..19bd910bee198325b59472039f1ce15c3518f3f4 100755 (executable)
--- a/index.ts
+++ b/index.ts
@@ -100,7 +100,7 @@ async function init() {
     devtools: { type: 'boolean' }
   } as const
 
-  const { values: argv } = parseArgs({
+  const { values: argv, positionals } = parseArgs({
     args,
     options,
     strict: false
@@ -123,7 +123,7 @@ async function init() {
       (argv.devtools || argv['vue-devtools'])
     ) === 'boolean'
 
-  let targetDir = args[0]
+  let targetDir = positionals[0]
   const defaultProjectName = !targetDir ? 'vue-project' : targetDir
 
   const forceOverwrite = argv.force