From 8ead3ab641c5662052a5e999ac06ed014b5ec9a1 Mon Sep 17 00:00:00 2001 From: Jamal Chahir Date: Sat, 28 Sep 2024 11:41:31 +0100 Subject: [PATCH] Update mkbsd.js Add count of images before starting download --- mkbsd.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkbsd.js b/mkbsd.js index d02593a..62f6362 100644 --- a/mkbsd.js +++ b/mkbsd.js @@ -19,6 +19,10 @@ async function main() { if (!data) { throw new Error('⛔ JSON does not have a "data" property at its root.'); } + + const count = data ? Object.keys(data).length : 0; + console.info(`Found ${count} images..`); + const downloadDir = path.join(__dirname, 'downloads'); if (!fs.existsSync(downloadDir)) { fs.mkdirSync(downloadDir);