mirror of
https://github.com/fawazahmed0/exchange-api.git
synced 2025-07-01 19:13:03 +00:00
create currenciesDir before saving files in it
This commit is contained in:
parent
6ecb76b5cb
commit
841a934311
@ -185,6 +185,9 @@ function sortObjByKeys(obj) {
|
|||||||
// Generates the api files
|
// Generates the api files
|
||||||
async function generateFiles(googBingCurrJSON) {
|
async function generateFiles(googBingCurrJSON) {
|
||||||
const currenciesDir = path.join(rootDir, 'currencies')
|
const currenciesDir = path.join(rootDir, 'currencies')
|
||||||
|
fs.mkdirSync(currenciesDir, {
|
||||||
|
recursive: true
|
||||||
|
})
|
||||||
for (const [fromKey, fromValue] of Object.entries(googBingCurrJSON)) {
|
for (const [fromKey, fromValue] of Object.entries(googBingCurrJSON)) {
|
||||||
const tempObj = {}
|
const tempObj = {}
|
||||||
tempObj['date'] = dateToday;
|
tempObj['date'] = dateToday;
|
||||||
|
Loading…
Reference in New Issue
Block a user