Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable tools view regeneration on a build time #2264

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
30 changes: 28 additions & 2 deletions scripts/build-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ const manualTools = require('../config/tools-manual.json')
const fs = require('fs');
const { resolve } = require('path');

const combineAutomatedAndManualTools = async (automatedTools) => {
try {
await combineTools(automatedTools, manualTools);
} catch (err) {
console.log("Error while combining tools:", err);
throw err;
}
};

const buildTools = async () => {
try {
let githubExtractData = await getData();
Expand All @@ -14,11 +23,28 @@ const buildTools = async () => {
resolve(__dirname, '../config', 'tools-automated.json'),
JSON.stringify(automatedTools, null, ' ')
);
await combineTools(automatedTools, manualTools);
await combineAutomatedAndManualTools(automatedTools);
} catch (err) {
console.log(err);
throw err
}
};

buildTools();
const buildToolsManual = async () => {
try {
const automatedTools = require('../config/tools-automated.json');
await combineAutomatedAndManualTools(automatedTools);
} catch (err) {
console.log(err);
throw err;
}
};

derberg marked this conversation as resolved.
Show resolved Hide resolved
if (require.main === module) {
buildTools();
}

module.exports = {
buildTools,
buildToolsManual
};
2 changes: 2 additions & 0 deletions scripts/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const rssFeed = require('./build-rss');
const buildPostList = require('./build-post-list');
const buildCaseStudiesList = require('./casestudies');
const { buildToolsManual } = require('./build-tools');

async function start() {
await buildPostList();
Expand All @@ -17,6 +18,7 @@ async function start() {
'jobs/rss.xml'
);
await buildCaseStudiesList();
await buildToolsManual();
}

start();
Loading