0
0
mirror of https://github.com/fawazahmed0/exchange-api.git synced 2025-06-30 10:33:50 +00:00

create currenciesDir before saving files in it

This commit is contained in:
Fawaz Ahmed 2024-03-01 10:30:30 +05:30
parent 6ecb76b5cb
commit 841a934311

View File

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