Skip to content

Commit 4578a8c

Browse files
fix(create-app): handle invalid template (#3615)
1 parent d5e0b26 commit 4578a8c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/create-app/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,19 @@ async function init() {
214214
return
215215
}
216216

217-
const packageName = result.packageName
217+
// user choice associated with prompts
218+
const { framework, overwrite, packageName, variant } = result
219+
218220
const root = path.join(cwd, targetDir)
219221

220-
if (result.overwrite) {
222+
if (overwrite) {
221223
emptyDir(root)
222224
} else if (!fs.existsSync(root)) {
223225
fs.mkdirSync(root)
224226
}
225227

226228
// determine template
227-
template = template || result.variant || result.framework
229+
template = variant || framework || template
228230

229231
console.log(`\nScaffolding project in ${root}...`)
230232

0 commit comments

Comments
 (0)