Skip to content

Commit

Permalink
Update generateData.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ReuschelCGN authored Sep 27, 2024
1 parent c019eb1 commit 2fc99f0
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/util/generateData.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,17 @@ const update = async function update() {
}

// Write grunts
if (process.argv[2] === 'latest') {
try {
log.info('Fetching latest invasions...')
fs.writeFileSync(
'./src/util/grunts.json',
await fetch('https://raw.githubusercontent.com/WatWowMap/event-info/main/grunts/formatted.json'),
'utf8',
)
log.info('Latest grunts saved...')
} catch (e) {
try {
log.info('Fetching latest invasions...')
const gruntFile = await fetch('https://raw.githubusercontent.com/WatWowMap/event-info/main/grunts/formatted.json')
fs.writeFileSync(
'./src/util/grunts.json',
JSON.stringify(gruntFile, null, 2),
'utf8',
)
log.info('Latest grunts saved...')
} catch (e) {
log.warn('Could not generate new invasions, using existing...')
}
}

// Write locales
Expand Down

0 comments on commit 2fc99f0

Please sign in to comment.