Since in a server environment JSON files often contain settings,
nodemon should restart by default when the content of a JSON file is changed.
Closes#643
Pass the `usePolling` flag to Chokidar when in legacy mode, which is supposed to/hopefully fix containers watching network attached drives.
Fixes#639Fixes#633
This was copied and pasted more than a handful of times around the
library and tests. Some implementations were more naive and did not
try to add quotes if there are spaces within a single argument.
There is one slight oddity in one of the cli parse tests. Stringifying
the command causes many of the arguments to show up in quotes when they
probably shouldn't. This seems to trace back to a deep problem related
to how commands are pulled out of package.scripts.start and is out of
scope for this patch. Even though the test might look incorrect now, it
is an accurate reflection of what the generated command is.
Previously, the --nodejs flag was being prepended if you had any
arguments prefixed with '--', even if they were intended for your
application. There is an additional problem where arguments intended for
node js need to be grouped into a single argument passed after --nodejs.
After this patch, any flag before your script is considered a nodejs
argument. These, along with any other exec arguments are bundled into a
single argument separated by spaces.
Fixes#530
- Also update tests to check end value, not individual parts
- Simplify tests to check actual output, rather than the pieces that make the output
- Remove redundant code: such a shame, it was cool code, but I'd rather remove it for simplicity and better support. Woot.
Full tests need to run to work out if this is okay to merge, but the logic is that we only go to the package.json for an executable IIF there's no script. If there's a script, then we shouldn't need to discover anything and we'll let the logic fall through the usual path (and usually default to node).
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).
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).
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.
Fixes#333 and fixes#335. Amazingly Windows support always had the full process tree being killed, but this solves it for mac and linux now. My only grip is we have a new dependancy for the project, but I don't really think that's such a big deal.
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.