Update mkbsd.js

Add count of images before starting download
This commit is contained in:
Jamal Chahir 2024-09-28 11:41:31 +01:00 committed by GitHub
parent 82e50c64f0
commit 8ead3ab641
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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