Skip to content

Commit

Permalink
feat: skip .git when emptying dir (#9659)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea authored Aug 13, 2022
1 parent afbb87d commit 07fe65e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/create-vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ function emptyDir(dir) {
return
}
for (const file of fs.readdirSync(dir)) {
if (file === '.git') {
continue
}
fs.rmSync(path.resolve(dir, file), { recursive: true, force: true })
}
}
Expand Down

0 comments on commit 07fe65e

Please sign in to comment.