legacyMigrator: don't consider log migration if the logs folder is empty
parent
1fa4975e18
commit
c865eb9d56
|
@ -58,10 +58,10 @@ async function shouldMigrate() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the log file dir exists, we need to migrate
|
// If the log file dir exists and has logs in it, we need to migrate
|
||||||
try {
|
try {
|
||||||
await access(config.logDir);
|
const files = await readDir(config.logDir);
|
||||||
return true;
|
if (files.length > 1) return true; // > 1, since .gitignore is one of them
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue