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