Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ignoredFiles is an empty array by default #5

Closed
wants to merge 1 commit into from

2 participants

@darvelo

Having ignoredFiles default to an empty array guarantees scrubbing the .nodemonignore file with fresh data every time the task is run. Currently if the user doesn't specify ignoredFiles or comments it out, thinking this will clear it, the .nodemonignore file is left untouched when the task is run.

Change for #4

@darvelo darvelo ignoredFiles is empty by default in case user leaves it unspecified. …
…This guarantees scrubbing the .nodemonignore file with fresh data every time the task is run.
8d0b40d
@ChrisWren
Owner

@appleYaks,

Thanks again for your contributions. Your criticism has been extremely valuable in advancing this project.

I didn't accept this pull request for a few reasons:

  • it creates a .nodemonignore file if the user leaves the ignoredFiles field blank
  • I want to removed the .nodemonignore if the user removes the ignoredFiles field rather than make it blank
  • You provided no tests to verify your new feature worked.
  • You used the options function incorrectly, instead it should be implemented like this:
options = this.options({
  ignoredFiles: []
});

It takes an object of default values as a parameter.

I welcome further contributions from you, and if you submit a more thorough pull request I would be willing to accept it after discussion. In this case I had to change so much that I implemented it myself: a79f924

@ChrisWren ChrisWren closed this
@darvelo

Ah, that functionality is better, not least because it leaves a custom .nodemonignore file alone. Well done!

And yep, you're right on all counts. Thanks for teaching me that bit about grunt options, and reminding me about tests. This was my first crack at it, so I guess non-correctness is to be expected. I'll remember to be more thorough in the future. And thanks for being hospitable as well. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 3, 2013
  1. @darvelo

    ignoredFiles is empty by default in case user leaves it unspecified. …

    darvelo authored
    …This guarantees scrubbing the .nodemonignore file with fresh data every time the task is run.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 tasks/nodemon.js
View
6 tasks/nodemon.js
@@ -12,8 +12,12 @@ module.exports = function (grunt) {
grunt.registerMultiTask('nodemon', 'Starts a nodemon server.', function () {
var command = [];
- var options = this.options();
var done = this.async();
+ var options = {
+ ignoredFiles: [] // default is to not ignore any files (js files also by default)
+ };
+
+ options = grunt.util._.extend(options, this.options());
if (options.exec) {
command.push('--exec');
Something went wrong with that request. Please try again.