Refactor folder structure

This commit is contained in:
venashial
2022-06-17 19:58:01 -07:00
parent 8204139df8
commit 137fbb638b
110 changed files with 45 additions and 52 deletions

View File

@@ -0,0 +1,22 @@
import { fetch } from 'undici'
import { promises as fs } from 'fs'
import cliProgress from 'cli-progress'
export async function gameVersions(API_URL) {
const progressBar = new cliProgress.SingleBar({
format: 'Generating game versions | {bar} | {percentage}%',
barCompleteChar: '\u2588',
barIncompleteChar: '\u2591',
hideCursor: true,
})
progressBar.start(2, 0)
const gameVersions = await (await fetch(API_URL + 'tag/game_version')).json()
progressBar.increment()
// Write JSON file
await fs.writeFile('./generated/gameVersions.json', JSON.stringify(gameVersions))
progressBar.increment()
progressBar.stop()
}