Skip to content

Commit 47a98a1

Browse files
authored
feat(create-docusaurus): enable creation in current directory (#11611)
1 parent 75a529b commit 47a98a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/create-docusaurus/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,10 @@ async function getSiteName(
273273
return 'A website name is required.';
274274
}
275275
const dest = path.resolve(rootDir, siteName);
276-
if (await fs.pathExists(dest)) {
276+
if (siteName === '.' && (await fs.readdir(dest)).length > 0) {
277+
return logger.interpolate`Directory not empty at path=${dest}!`;
278+
}
279+
if (siteName !== '.' && (await fs.pathExists(dest))) {
277280
return logger.interpolate`Directory already exists at path=${dest}!`;
278281
}
279282
return true;

0 commit comments

Comments
 (0)