Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(create-app): handle invalid template
  • Loading branch information
jamesgeorge007 committed Jun 1, 2021
commit c8910da449e91d274aab44a8c48316240275ba81
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