Skip to content

Commit ac340b3

Browse files
bteaaklinker1
andauthored
fix: init project should allow the .git folder to exist (#1731)
Co-authored-by: Aaron <[email protected]>
1 parent a2097e1 commit ac340b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/wxt/src/core/initialize.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export async function initialize(options: {
5858

5959
const isExists = await fs.pathExists(input.directory);
6060
if (isExists) {
61-
const isEmpty = (await fs.readdir(input.directory)).length === 0;
61+
const isEmpty =
62+
(await fs.readdir(input.directory)).filter((dir) => dir !== '.git')
63+
.length === 0;
6264
if (!isEmpty) {
6365
consola.error(
6466
`The directory ${path.resolve(input.directory)} is not empty. Aborted.`,

0 commit comments

Comments
 (0)