Skip to content

Commit

Permalink
fix: d4dc4e2-introduced error (#100)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
tyler-reitz authored and Kent C. Dodds committed Jun 20, 2018
1 parent 3f2ae00 commit 54febd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/config-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
)
Expand Down

0 comments on commit 54febd3

Please sign in to comment.