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) {
|
const storeAppList = async function (builder) {
|
||||||
// TODO: Make DRY
|
// TODO: Make DRY
|
||||||
|
|
||||||
|
console.log('Build Lists started')
|
||||||
|
|
||||||
const appListPath = path.join(
|
const appListPath = path.join(
|
||||||
// builder.nuxt.options.buildDir,
|
// builder.nuxt.options.buildDir,
|
||||||
builder.nuxt.options.srcDir,
|
builder.nuxt.options.srcDir,
|
||||||
|
|
@ -21,12 +23,23 @@ const storeAppList = async function (builder) {
|
||||||
'/static/game-list.json'
|
'/static/game-list.json'
|
||||||
)
|
)
|
||||||
|
|
||||||
const appList = await buildAppList()
|
// const appList = await buildAppList()
|
||||||
const gamesList = await buildGamesList()
|
// const gamesList = await buildGamesList()
|
||||||
|
|
||||||
// console.log('builder.nuxt.options', builder.nuxt.options)
|
const [
|
||||||
await fs.writeFile(appListPath, JSON.stringify(appList))
|
appList,
|
||||||
await fs.writeFile(gamesListPath, JSON.stringify(gamesList))
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue