Skip to content

Commit

Permalink
create currenciesDir before saving files in it
Browse files Browse the repository at this point in the history
  • Loading branch information
fawazahmed0 committed Mar 1, 2024
1 parent 6ecb76b commit 841a934
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions currscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 841a934

Please sign in to comment.