Skip to content

Commit

Permalink
fix: only log target exist when error says so
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 5, 2020
1 parent c82a597 commit 59b8638
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion create-vite-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ async function init() {
try {
await mkdir(root)
} catch (e) {
console.error(`Error: target directory already exists.`)
if (e.code === 'EEXIST') {
console.error(`Error: target directory already exists.`)
} else {
throw e
}
return
}

Expand Down

0 comments on commit 59b8638

Please sign in to comment.