From: Haoqun Jiang Date: Mon, 11 Mar 2024 14:27:49 +0000 (+0800) Subject: fix: targetDir should be inferred from positionals instead of args X-Git-Tag: v3.10.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2d52a829f54a59d9f65aac6a82d3c2336aee7cc;p=thirdparty%2Fvuejs%2Fcreate-vue.git fix: targetDir should be inferred from positionals instead of args Fixes #464 --- diff --git a/index.ts b/index.ts index 03ee00c5..19bd910b 100755 --- 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