Skip to content

Commit

Permalink
fixed buildAll not waiting for defs to be saved
Browse files Browse the repository at this point in the history
  • Loading branch information
matortheeternal committed Jan 29, 2022
1 parent ab12bcb commit 088551c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Generator/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
10 changes: 7 additions & 3 deletions tasks/buildAll.js
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 088551c

Please sign in to comment.