Implement `--config <file>` option to allow config loading from an arbitrary file instead of being
bound to the static `$PWD/nodemon.json`.
Closes#755Closes#855
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.
If you try to run nodemon with a coffee file script and pass an
argument to your application, it is instead adding a --nodejs when there
are no node flags to pass along. This causes the command to fail because
the script name is now passed as a flag to node.
Repro:
nodemon script.coffee --my-argument
Expected:
coffee script.coffee --my-argument
Actual:
coffee --nodejs script.coffee --my-argument
Related to #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.
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).
Now (like 0.x nodemon) nodemon will look for it's arguments in all the cli args - including *after* the user script. But additionally, if the user uses the `--` flag, nodemon will stop eating arguments, and pass them all to the user script.