Skip to content

Commit

Permalink
fix: JSON extension not watched when "scriptExt" is defined
Browse files Browse the repository at this point in the history
Fix a bug that caused ".json" files to not be watched by default.

closes #643
  • Loading branch information
pensierinmusica committed Oct 20, 2015
1 parent e9d85b2 commit 4c195df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/config/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function exec(nodemonOptions, execMap) {
var options = utils.clone(nodemonOptions || {});
var script = path.basename(options.script || '');
var scriptExt = path.extname(script).slice(1);
var extension = options.ext || scriptExt || 'js,json';
var extension = options.ext || scriptExt + ',json' || 'js,json';
var execDefined = !!options.exec;

// allows the user to simplify cli usage:
Expand Down

4 comments on commit 4c195df

@paramaggarwal
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it will never fallback to the last 'js,json'. So if I use nodemon ./bin/www, it will only watch for json files. Please revert this change. Causing nodemon to fail for everyone in #685.

@pensierinmusica
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paramaggarwal thanks for pointing this out, I'll send a patch (simply reverting would not allow 'json' files to be watched by default).

@pensierinmusica
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! #714

@paramaggarwal
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks much @pensierinmusica!

Please sign in to comment.