legacyMigrator: don't consider log migration if the logs folder is empty

master
Dragory 2018-02-24 12:46:02 +02:00
parent 1fa4975e18
commit c865eb9d56
1 changed files with 3 additions and 3 deletions

View File

@ -58,10 +58,10 @@ async function shouldMigrate() {
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 {
await access(config.logDir);
return true;
const files = await readDir(config.logDir);
if (files.length > 1) return true; // > 1, since .gitignore is one of them
} catch(e) {}
return false;