From c865eb9d56be5b1617b3bc0e3e8a8c7200c12827 Mon Sep 17 00:00:00 2001 From: Dragory Date: Sat, 24 Feb 2018 12:46:02 +0200 Subject: [PATCH] legacyMigrator: don't consider log migration if the logs folder is empty --- src/legacy/legacyMigrator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/legacy/legacyMigrator.js b/src/legacy/legacyMigrator.js index cf70dca..3f4dfd3 100644 --- a/src/legacy/legacyMigrator.js +++ b/src/legacy/legacyMigrator.js @@ -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;