From 206ded55ff8e6b73ee41fa4951630352792b543e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sun, 10 Dec 2017 01:03:00 -0500 Subject: [PATCH] Warn if user configuration being loaded is empty --- src/helper.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/helper.js b/src/helper.js index 052e4115..20cdebe2 100644 --- a/src/helper.js +++ b/src/helper.js @@ -79,7 +79,14 @@ function setHome(newPath) { // Reload config from new home location if (fs.existsSync(configPath)) { - var userConfig = require(configPath); + const userConfig = require(configPath); + + if (_.isEmpty(userConfig)) { + log.warn(`The file located at ${colors.green(configPath)} does not appear to expose anything.`); + log.warn(`Make sure it is non-empty and the configuration is exported using ${colors.bold("module.exports = { ... }")}.`); + log.warn("Using default configuration..."); + } + this.config = _.merge(this.config, userConfig); }