We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e75107 commit 485378dCopy full SHA for 485378d
src/cli/run.js
@@ -188,7 +188,14 @@ module.exports = function (argv) {
188
const watchedFile = path.resolve(watchedDir, file)
189
if (watchedFile === path.resolve(source)) {
190
if (is.JSON(watchedFile)) {
191
- var obj = JSON.parse(fs.readFileSync(watchedFile))
+ var obj = null;
192
+ try {
193
+ obj = JSON.parse(fs.readFileSync(watchedFile));
194
+ } catch (e) {
195
+ console.log('The format of the json file is not right, please check.');
196
+ console.dir(e);
197
+ return;
198
+ }
199
// Compare .json file content with in memory database
200
var isDatabaseDifferent = !_.isEqual(obj, app.db.getState())
201
if (isDatabaseDifferent) {
0 commit comments