From 841a9343116950c6cb19678c16e6417aa1eba7a8 Mon Sep 17 00:00:00 2001 From: Fawaz Ahmed Date: Fri, 1 Mar 2024 10:30:30 +0530 Subject: [PATCH] create currenciesDir before saving files in it --- currscript.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/currscript.js b/currscript.js index 73c0e9f..8a77833 100644 --- a/currscript.js +++ b/currscript.js @@ -185,6 +185,9 @@ function sortObjByKeys(obj) { // Generates the api files async function generateFiles(googBingCurrJSON) { const currenciesDir = path.join(rootDir, 'currencies') + fs.mkdirSync(currenciesDir, { + recursive: true + }) for (const [fromKey, fromValue] of Object.entries(googBingCurrJSON)) { const tempObj = {} tempObj['date'] = dateToday;