From 8cdd10274f1af86f70d380942d0ca3dcb08337be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Fri, 17 Mar 2017 18:52:36 +0100 Subject: [PATCH] Use empty array if routes not given --- lib/generate.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/generate.js b/lib/generate.js index 7587d6ff90..99ee140463 100644 --- a/lib/generate.js +++ b/lib/generate.js @@ -52,11 +52,12 @@ export default function () { }) .then(() => { // Resolve config.generate.routes promises before generating the routes - return promisifyRoute(this.options.generate.routes) + return promisifyRoute(this.options.generate.routes || []) .catch((e) => { - console.error(`Could not resolve routes`) // eslint-disable-line no-console + console.error('Could not resolve routes') // eslint-disable-line no-console console.error(e) // eslint-disable-line no-console process.exit(1) + throw e }) }) .then((generateRoutes) => {