* fix: package.main with -- arguments
Fixes#1758
The combination of using a package.main (which sets the script
position to index zero) and using the -- stop slurp meant that
the arguments had the script appended to the end instead of
prepended to the start. The net result meant that when the script
was forked, it would drop the first user arg.
See diff for details of the fix - a simple check against null.
* fix: protect against missing opts
Fixes#1263
The way it works:
- If the script is detected via index.js from the directory, or from the
package, then all the arguments on the CLI are shifted to execArgs
- If there was a double-dash on the CLI args, then only those before the
double-dash are given to execArgs and the rest remain passed to the
script
* fix: pass through execArgs from config
Also updating some deps and linting tweaks
* chore: add message on postinstall
Lost funds from gratipay and codesponsor 😢
If I have a nodemon.json config file with an `exec` property, then this is automatically appended with ` index.js` when running `nodemon` standalone.
I would expect this to be equivalent to running `nodemon --exec "my cmd"` - that is providing an `exec` prevents defaulting of `script` to index.js.
To resolve, move the code which defaults the `script` property when `exec` is undefined to after the config files have been read, so that the behaviour is the same irrespective of whether properties are set in CLI flags or in nodemon.json.
* feat: support using ‘nodemonConfig’ in package.json
Implements loading configuration options from the `nodemonConfig` value in the package.json, nodemon.json is still preferred before looking at the new option.
Also includes tests.
Closes#873
* docs: update for using ‘nodemonConfig’ in package.json
Add to both the README and `nodemon --help config`.
#1028
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 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).
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.
Needs careful testing in linux and windows.
Also fixed#204 but requires config file to set `restartable` to false, since there's so many options to configure stdin and this particular case has narrow use.