From 54febd3c45f1d9563d084abef9976d0edc6015b4 Mon Sep 17 00:00:00 2001 From: Tyler Reitz Date: Tue, 19 Jun 2018 20:21:12 -0700 Subject: [PATCH] fix: d4dc4e2-introduced error (#100) * adds helpful error message when files is overridden or empty * fix: d4dc4e2-introduced error The prior commit to this branch d4dc4e2 introduced an error in the util/config.js file where it checks for the length of the content.files property, whether that property exists in the config or not. --- src/util/config-file.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/config-file.js b/src/util/config-file.js index 3fd4853..34bd561 100644 --- a/src/util/config-file.js +++ b/src/util/config-file.js @@ -24,7 +24,8 @@ function writeConfig(configPath, content) { if (!content.projectName) { throw new Error(`Error! Project name is not set in ${configPath}`) } - if (!content.files.length) { + + if (content.files && !content.files.length) { throw new Error( `Error! Project files was overridden and is empty in ${configPath}`, )