Use empty array if routes not given

This commit is contained in:
Sébastien Chopin 2017-03-17 18:52:36 +01:00
parent 0a9477dc7b
commit 8cdd10274f

View File

@ -52,11 +52,12 @@ export default function () {
}) })
.then(() => { .then(() => {
// Resolve config.generate.routes promises before generating the routes // Resolve config.generate.routes promises before generating the routes
return promisifyRoute(this.options.generate.routes) return promisifyRoute(this.options.generate.routes || [])
.catch((e) => { .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 console.error(e) // eslint-disable-line no-console
process.exit(1) process.exit(1)
throw e
}) })
}) })
.then((generateRoutes) => { .then((generateRoutes) => {