mirror of
https://github.com/one-among-us/data.git
synced 2025-03-29 05:57:12 +08:00
[F] Fix empty dir check
This commit is contained in:
parent
902cfcb492
commit
2e9418789b
@ -258,5 +258,7 @@ function trim(str: string, ch: string) {
|
||||
}
|
||||
|
||||
function isDirEmpty(dir: string): boolean {
|
||||
return fs.readdirSync(dir).length == 0;
|
||||
if (fs.readdirSync(dir).length == 0) return true;
|
||||
else if ((fs.readdirSync(dir).length == 1) && (fs.readdirSync(dir)[0] == 'comments')) return true;
|
||||
return false;
|
||||
}
|
Loading…
Reference in New Issue
Block a user