Skip to content

Commit

Permalink
feat(create-app): better prompt message
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Apr 24, 2021
1 parent 5fe9a69 commit 9c1d279
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/create-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ async function init() {
} else {
const existing = fs.readdirSync(root)
if (existing.length) {
// determine directory name
const baseDir = targetDir === '.' ? path.basename(cwd) : targetDir

/**
* @type {{ yes: boolean }}
*/
Expand All @@ -155,7 +158,7 @@ async function init() {
name: 'yes',
initial: 'Y',
message:
`Target directory ${targetDir} is not empty.\n` +
( targetDir === '.' ? 'Current directory' : `Target directory ${targetDir} ) + ` is not empty.\n` +
`Remove existing files and continue?`
})
if (yes) {
Expand Down

0 comments on commit 9c1d279

Please sign in to comment.