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).
If trailing is not set to false, a setTimeOut is called if you call the
function when it is 'locked', so you need to set trailing to false to
avoid that unnecessary call
setTimeout.
This changes the behaviour of the option --delay n
This means that as soon as one file changes, nodemon will restart the
script. The previous behavior was to wait for n seconds before
restarting the process. With throttle, the function gets called when the
first file changes. After that, all file changes in the interval [t,t+n]
are ignored
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).
It was losing quotes around arguments, and in fact only needs to capture the first element in the string as the exec, and the rest could be left as is (if I keep the `sh` method of execution).
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"
}
}
Closes#418Closes#419
This version will handle quoted entities in the exec string or escaped spaces correctly, so the user can run:
--exec '"/bin/my cool app" {{filename}}'
Or
--exec '/bin/my\ cool\ app {{filename}}'
This will work both on the command line and from the API.