From 573f850795721db907aa0d2649241015451e0c57 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sat, 13 Aug 2022 18:20:29 +0800 Subject: [PATCH] chore: skip `.git` when emptying dir --- packages/create-vite/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/create-vite/index.js b/packages/create-vite/index.js index 40d0aa583124d3..6ba1214a1829bb 100755 --- a/packages/create-vite/index.js +++ b/packages/create-vite/index.js @@ -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 }) } }