aboutsummaryrefslogtreecommitdiffstats
path: root/app/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'app/index.ts')
-rw-r--r--app/index.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/index.ts b/app/index.ts
index 1cb278a..f7a443d 100644
--- a/app/index.ts
+++ b/app/index.ts
@@ -21,12 +21,19 @@ logger.info('');
const {success, errors, pageDirectory} = await buildPages();
logger.info('');
-if (!success) {
+if (!success && errors == 0) {
logger.error(`Build failed. Quitting.`);
process.exit(1);
}
-logger.info(`Finished${errors > 0 ? `, with ${errors} errors` : ''}. Build took ${new Date().getTime() - startDate.getTime()}ms.`);
+const exitString = `Finished${errors > 0 ? `, with ${errors} errors` : ''}. Build took ${new Date().getTime() - startDate.getTime()}ms.`;
+
+if (!success) {
+ logger.error(exitString);
+ process.exit(1);
+} else {
+ logger.info(exitString);
+}
if (process.env.WEBSERVER_ENABLED === 'true') {
logger.info('');