From 0d226759234e7970d60e86d21b4f551bbbde7cec Mon Sep 17 00:00:00 2001 From: saif Date: Wed, 1 Jan 2025 16:12:03 +0500 Subject: [PATCH] add screesnshots date wise for debugging --- sync-orders.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sync-orders.js b/sync-orders.js index a5c91e4..d0b5347 100644 --- a/sync-orders.js +++ b/sync-orders.js @@ -12,7 +12,14 @@ const utils = require("./utils"); (async function () { console.log(`===========< STARTED ${luxon.DateTime.now()} >=========`); - const screenshotDirectory = path.join(__dirname, "screenshots"); + + const syncDate = luxon.DateTime.now().toFormat("yyyy-MM-dd"); + + const screenshotDirectory = path.join(__dirname, `screenshots/${syncDate}`); + + if ( !fs.existsSync(screenshotDirectory) ) { + fs.mkdirSync( screenshotDirectory, { recursive: true }); +} /** * loading config data