fix(exeptions): do not ignore build errors
This commit is contained in:
@@ -48,12 +48,11 @@ process.env.NODE_ENV = "production";
|
||||
process.on("unhandledRejection", function (err) {
|
||||
throw err;
|
||||
});
|
||||
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var radar, rawConf, config, e_1;
|
||||
var createStaticFiles = function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var radar, rawConf, config;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
_a.trys.push([0, 2, , 3]);
|
||||
console.log("starting static");
|
||||
return [4 /*yield*/, (0, radar_1.createRadar)()];
|
||||
case 1:
|
||||
@@ -72,13 +71,17 @@ process.on("unhandledRejection", function (err) {
|
||||
radar.items.forEach(function (item) {
|
||||
(0, fs_1.copyFileSync)("build/index.html", "build/".concat(item.quadrant, "/").concat(item.name, ".html"));
|
||||
});
|
||||
console.log("created static files.");
|
||||
return [3 /*break*/, 3];
|
||||
case 2:
|
||||
e_1 = _a.sent();
|
||||
console.error("error:", e_1);
|
||||
return [3 /*break*/, 3];
|
||||
case 3: return [2 /*return*/];
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); })();
|
||||
}); };
|
||||
createStaticFiles()
|
||||
.then(function () {
|
||||
console.log("created static files.");
|
||||
})
|
||||
.catch(function (err) {
|
||||
if (err && err.message) {
|
||||
console.error(err.message);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -74,27 +74,19 @@ process.on("unhandledRejection", function (err) {
|
||||
fs.removeSync(paths.templateNodeModules);
|
||||
fs.ensureSymlinkSync(paths.appNodeModules, paths.templateNodeModules);
|
||||
var generateJson = function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var createRadar, save, radar, e_1;
|
||||
var createRadar, save, radar;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
createRadar = require("./generateJson/radar").createRadar;
|
||||
save = require("./generateJson/file").save;
|
||||
_a.label = 1;
|
||||
case 1:
|
||||
_a.trys.push([1, 4, , 5]);
|
||||
return [4 /*yield*/, createRadar()];
|
||||
case 2:
|
||||
case 1:
|
||||
radar = _a.sent();
|
||||
return [4 /*yield*/, save(JSON.stringify(radar), paths.radarJson)];
|
||||
case 3:
|
||||
case 2:
|
||||
_a.sent();
|
||||
return [3 /*break*/, 5];
|
||||
case 4:
|
||||
e_1 = _a.sent();
|
||||
console.error("error:", e_1);
|
||||
return [3 /*break*/, 5];
|
||||
case 5: return [2 /*return*/];
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); };
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -21,13 +21,8 @@ const generateJson = async () => {
|
||||
const { createRadar } = require("./generateJson/radar");
|
||||
const { save } = require("./generateJson/file");
|
||||
|
||||
try {
|
||||
const radar = await createRadar();
|
||||
|
||||
await save(JSON.stringify(radar), paths.radarJson);
|
||||
} catch (e) {
|
||||
console.error("error:", e);
|
||||
}
|
||||
const radar = await createRadar();
|
||||
await save(JSON.stringify(radar), paths.radarJson);
|
||||
};
|
||||
|
||||
generateJson()
|
||||
|
||||
Reference in New Issue
Block a user