Skip to content

Commit a5bdb9f

Browse files
authored
feat(create-vite): scaffold directory with only .git (#7971)
1 parent 891e7fc commit a5bdb9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/create-vite/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ function copyDir(srcDir, destDir) {
313313
}
314314

315315
function isEmpty(path) {
316-
return fs.readdirSync(path).length === 0
316+
const files = fs.readdirSync(path)
317+
return files.length === 0 || (files.length === 1 && files[0] === '.git')
317318
}
318319

319320
function emptyDir(dir) {

0 commit comments

Comments
 (0)