Skip to content

Commit

Permalink
feat(build): improve error message for when semantic.json is not found
Browse files Browse the repository at this point in the history
Improve error message for when semantic.json cannot be found.

I was having an issue with my setup where semantic.json couldn't be found. Looking at require-dot-file, it seems false is returned when semantic.json isn't found. An error is printed only when the MODULE_NOT_FOUND error is thrown which wasn't happening in my case.
  • Loading branch information
dmp1ce committed Oct 30, 2022
1 parent a1262ef commit 51e0c45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tasks/config/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ var
try {
// looks for config file across all parent directories
userConfig = requireDotFile('semantic.json', process.cwd());
if(userConfig.valueOf() === false) {
console.error('No semantic.json config found');
}
}
catch(error) {
if(error.code === 'MODULE_NOT_FOUND') {
console.error('No semantic.json config found');
console.error('require-dot-file module not found');
}
}

Expand Down

0 comments on commit 51e0c45

Please sign in to comment.