mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-25 17:22:50 +00:00
feat(create-docusaurus): enable creation in current directory (#11611)
This commit is contained in:
parent
75a529bb8f
commit
47a98a1d6e
|
|
@ -273,7 +273,10 @@ async function getSiteName(
|
|||
return 'A website name is required.';
|
||||
}
|
||||
const dest = path.resolve(rootDir, siteName);
|
||||
if (await fs.pathExists(dest)) {
|
||||
if (siteName === '.' && (await fs.readdir(dest)).length > 0) {
|
||||
return logger.interpolate`Directory not empty at path=${dest}!`;
|
||||
}
|
||||
if (siteName !== '.' && (await fs.pathExists(dest))) {
|
||||
return logger.interpolate`Directory already exists at path=${dest}!`;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue