1
0
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:
Elihuso Quigley 2025-03-03 16:33:24 +08:00
parent 902cfcb492
commit 2e9418789b

View File

@ -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;
}