diff --git a/src/Generator/generator.js b/src/Generator/generator.js index 91c86b82..1d7e13c9 100644 --- a/src/Generator/generator.js +++ b/src/Generator/generator.js @@ -63,13 +63,13 @@ let saveIndividualDefs = function(game) { }); }; -let generate = function(game, options = {}) { +let generate = async function(game, options = {}) { clearDefs(); let defsFolder = options.buildFrom || game; buildDefs(game, defsFolder); buildDefs(game, path.join(defsFolder, 'extra')); buildDefs(game, path.join(defsFolder, 'adjustments')); - saveDefs(game, options); + await saveDefs(game, options); if (options.saveIndividualDefs) saveIndividualDefs(game); }; diff --git a/tasks/buildAll.js b/tasks/buildAll.js index a3996c3b..251c7393 100644 --- a/tasks/buildAll.js +++ b/tasks/buildAll.js @@ -1,6 +1,10 @@ const {generate} = require("../src/Generator/generator"); const games = ['FO4', 'SSE', 'TES5', 'TES4', 'FO3', 'FNV']; -games.forEach(game => { - generate(game, { saveIndividualDefs: true, saveFormattedDefs: true }); -}); + +let buildAll = async function() { + for (let game of games) + await generate(game, { saveIndividualDefs: true, saveFormattedDefs: true }); +}; + +buildAll();