Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incident reward list fix #912

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"generate": "node src/util/generateData.js",
"koji": "node src/util/koji.js",
"init": "node src/init/initConfig.js",
"latest": "npm run generate latest && npm run koji && node .",
"lint": "./node_modules/.bin/eslint ./src --fix",
"migrateV3": "node src/init/migrateV3.js",
"prepare": "husky",
Expand Down
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