fix(exeptions): do not ignore build errors
This commit is contained in:
@@ -14,31 +14,36 @@ process.on("unhandledRejection", (err) => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
console.log("starting static");
|
||||
const radar = await createRadar();
|
||||
const createStaticFiles = async () => {
|
||||
console.log("starting static");
|
||||
const radar = await createRadar();
|
||||
|
||||
copyFileSync("build/index.html", "build/overview.html");
|
||||
copyFileSync("build/index.html", "build/help-and-about-tech-radar.html");
|
||||
const rawConf = readFileSync("build/config.json", "utf-8");
|
||||
const config = JSON.parse(rawConf);
|
||||
Object.keys(config.quadrants).forEach((quadrant) => {
|
||||
const destFolder = `build/${quadrant}`;
|
||||
copyFileSync("build/index.html", `${destFolder}.html`);
|
||||
if (!existsSync(destFolder)) {
|
||||
mkdirSync(destFolder);
|
||||
}
|
||||
});
|
||||
radar.items.forEach((item) => {
|
||||
copyFileSync(
|
||||
"build/index.html",
|
||||
`build/${item.quadrant}/${item.name}.html`
|
||||
);
|
||||
});
|
||||
copyFileSync("build/index.html", "build/overview.html");
|
||||
copyFileSync("build/index.html", "build/help-and-about-tech-radar.html");
|
||||
const rawConf = readFileSync("build/config.json", "utf-8");
|
||||
const config = JSON.parse(rawConf);
|
||||
Object.keys(config.quadrants).forEach((quadrant) => {
|
||||
const destFolder = `build/${quadrant}`;
|
||||
copyFileSync("build/index.html", `${destFolder}.html`);
|
||||
if (!existsSync(destFolder)) {
|
||||
mkdirSync(destFolder);
|
||||
}
|
||||
});
|
||||
radar.items.forEach((item) => {
|
||||
copyFileSync(
|
||||
"build/index.html",
|
||||
`build/${item.quadrant}/${item.name}.html`
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
console.log("created static files.");
|
||||
} catch (e) {
|
||||
console.error("error:", e);
|
||||
}
|
||||
})();
|
||||
createStaticFiles()
|
||||
.then(() => {
|
||||
console.log(`created static files.`);
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err && err.message) {
|
||||
console.error(err.message);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user