Skip to content

Commit

Permalink
fix(create-app): handle invalid template (#3615)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Jun 1, 2021
1 parent d5e0b26 commit 4578a8c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/create-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,19 @@ async function init() {
return
}

const packageName = result.packageName
// user choice associated with prompts
const { framework, overwrite, packageName, variant } = result

const root = path.join(cwd, targetDir)

if (result.overwrite) {
if (overwrite) {
emptyDir(root)
} else if (!fs.existsSync(root)) {
fs.mkdirSync(root)
}

// determine template
template = template || result.variant || result.framework
template = variant || framework || template

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

Expand Down

0 comments on commit 4578a8c

Please sign in to comment.