Closes#455Closes#453Fixes#419
This method creates a file and checks the stat to check of an offset between the date on the machine and the created time on the file system. Docker (in my tests) show that you can get the offset using this method.
Once we have the offset, we tell the user (once) and then we use that to find files that have been modified according to the offset (either looking in the last using -mmin or in the future using -newer + a touched file).
This commit removes the duplication that happened at the options and options.execOptions level. Now all exec related information lives in options.execOptions.
I've updated all the references and tests that referred to things like options.script, etc.
This also fixes the (new) bug with exec argments not being placed in the right position when the script is detected via a package (so it reads `node --debug app.js` - this is resolved in command.js (due to the flattening of the config).
I've also fixed a few tests that said they were passing, but actually should have failed (but didn't because I was mocking too much of the code).
Allows user to have event handlers in the nodemon config, such as:
{
"events": {
"crash": "say 'your app crashed'",
"start": "echo 'App started' | tee app.log"
}
}
If a single file was being watched, it would use the tryBaseDir method to work out the directory, but fail as a pattern so it would return the base directory - which is too much. Now we test if that string is a real file or a directory, and if it is, it returns *that* back out.
Fixes#299 and fixes#308.
This means if you use nodemon to monitor a .js script, but explicitly watch another file (that isn't .js) then nodemon *will* restart as expected.
Changed it from using `.on('data')` to using a PassThrough stream which does the job much better, but the readline demos don't work when they're doing anything special on stdout, like `.cursorTo`. WIP.
Something weird is happening with required nodemon and re-running lots of times, that somehow resets the config. I know it's due to my tests, but I'm unsure which one is actually causing the damn issue. Anyway, bed for me, it's almost 2am. Sod this for a game of cricket.
Now using minimatch to match globs to files that have changed. Logic orders the rules in order of specificity (i.e. deeper paths have higher specificity) and the file runs through the rules.
Fixed nodemon to echo out what's being watched in the regexp instead of the config.dir path.
Also allowing patterns on the "watch" config setting, rather than just paths.
Removed useless test (that kept failing...incorrectly).