mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Allow lists to be built concurrently
This commit is contained in:
parent
d460de538b
commit
3b0404fbb0
1 changed files with 18 additions and 5 deletions
|
|
@ -9,6 +9,8 @@ import buildGamesList from './helpers/build-game-list.js'
|
|||
const storeAppList = async function (builder) {
|
||||
// TODO: Make DRY
|
||||
|
||||
console.log('Build Lists started')
|
||||
|
||||
const appListPath = path.join(
|
||||
// builder.nuxt.options.buildDir,
|
||||
builder.nuxt.options.srcDir,
|
||||
|
|
@ -21,12 +23,23 @@ const storeAppList = async function (builder) {
|
|||
'/static/game-list.json'
|
||||
)
|
||||
|
||||
const appList = await buildAppList()
|
||||
const gamesList = await buildGamesList()
|
||||
// const appList = await buildAppList()
|
||||
// const gamesList = await buildGamesList()
|
||||
|
||||
// console.log('builder.nuxt.options', builder.nuxt.options)
|
||||
await fs.writeFile(appListPath, JSON.stringify(appList))
|
||||
await fs.writeFile(gamesListPath, JSON.stringify(gamesList))
|
||||
const [
|
||||
appList,
|
||||
gamesList
|
||||
] = await Promise.all([
|
||||
buildAppList(),
|
||||
buildGamesList()
|
||||
])
|
||||
|
||||
await Promise.all([
|
||||
fs.writeFile(appListPath, JSON.stringify(appList)),
|
||||
fs.writeFile(gamesListPath, JSON.stringify(gamesList))
|
||||
])
|
||||
|
||||
console.log('Finished building JSON Lists')
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue