-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
223 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'dotenv/config' | ||
import { Command } from 'commander' | ||
import { updateAllProfiles } from './routes/player' | ||
import { updateAllReports, updateReport } from './routes/report' | ||
|
||
const program = new Command() | ||
|
||
program | ||
.command('update-profiles') | ||
.description('Update tracked profiles') | ||
.action(async () => { | ||
console.time('profiles update') | ||
const summary = await updateAllProfiles() | ||
console.timeEnd('profiles update') | ||
console.log(summary) | ||
}) | ||
|
||
program | ||
.command('update-reports') | ||
.description('Update AI reports') | ||
.action(async () => { | ||
console.time('reports update') | ||
const summary = await updateAllReports() | ||
console.timeEnd('reports update'); | ||
console.log(summary) | ||
}) | ||
|
||
program | ||
.command('update-report') | ||
.description('Update a report') | ||
.option('-l, --locale <locale>', 'Locale') | ||
.option('-m, --mode <mode>', 'Mode') | ||
.option('-p, --map <map>', 'Map') | ||
.action(async (options) => { | ||
console.time('report update') | ||
const { locale, mode, map } = options | ||
const summary = await updateReport(locale, mode, map) | ||
console.timeEnd('report update') | ||
console.log(summary) | ||
}) | ||
|
||
program.parse(process.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.