36 Commits

Author SHA1 Message Date
Remy Sharp
2967726673 fix: package.main with -- arguments (#1773)
* 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
2020-10-04 16:44:26 +01:00
Aurélio A. Heckert
7d6c1a88a1 fix: Replace jade references by pug
close #1595
2019-10-15 19:27:50 -04:00
Remy Sharp
8cb26bfe25 refactor: small tweaks to ES6-ish 2018-01-06 09:35:16 +00:00
Dominykas Blyžė
c5bf96c051 test: always wait for nodemon.reset() to complete in teardown 2017-12-20 14:08:53 +00:00
Remy Sharp
6a4fb22602 fix: pass through execArgs from config (#1142)
* fix: pass through execArgs from config

Also updating some deps and linting tweaks

* chore: add message on postinstall

Lost funds from gratipay and codesponsor 😢
2017-12-05 18:01:55 +00:00
Rich Hodgkins
fb5da380c8 feat: nodemonConfig support in package.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
2017-09-04 20:26:17 +01:00
Remy Sharp
526811d9b0 fix: make control over ignoreRoot easier
And add documentation and tests
2015-10-19 12:27:53 +01:00
Remy Sharp
be3b5b3aee test: updating tests for new pkg.start logic 2015-09-16 10:32:43 +01:00
Remy Sharp
15b0b88d0f feat: merge ignore rules with defaults
And allow the user to override the defaults from their config
2015-09-12 11:34:28 +01:00
Remy Sharp
7496f08330 fix: incorrectly exiting when required
test: updated travis tests
2015-09-09 22:29:26 +01:00
Doug Patti
56c4caf2ed pull command stringification into a utility
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.
2015-04-22 13:42:55 -04:00
Remy Sharp
d796e41120 Remove the need for execArgs when user specifying an exec
- 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.
2015-02-01 15:59:49 +00:00
Remy Sharp
b70b81612c Removed script, exec, ext from options
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).
2015-01-03 15:35:11 +00:00
Remy Sharp
7ee114a96d Updating tests with new execArgs 2015-01-01 21:47:38 +00:00
Remy Sharp
ee35ef8347 Fixed exec parser
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).
2015-01-01 20:50:59 +00:00
Remy Sharp
66e71d6b64 Fixes #383
Ensure we look at the package last, after reading cli options and user prefs via nodemon.json
2014-12-05 22:52:06 +00:00
Remy Sharp
827a8b5603 Fixed test
Before it was running the exec method which had a bug, so the test was being tested with buggy code (we thought we were running a user defined setting of exec="foo" through .load, but it was actually exec="node"). This change ensures we're only passing through exactly the amount the user would.
2014-12-05 22:45:07 +00:00
Remy Sharp
d97d92f65b Tweak output of tests to see what's failing 2014-12-05 22:44:40 +00:00
Mark Wubben
37491255c0 add breaking test for package.scripts.start overruling nodemon.json 2014-12-04 17:18:35 +00:00
Michael Heuberger
c4e263ed37 expose streams for piping (mh) 2014-06-04 02:49:24 +12:00
Remy Sharp
2a2f1260e4 If no script, default is null, not -1. Fixes #265
Includes test and exposing the command run for debugging.
2014-01-21 07:57:27 +00:00
Remy Sharp
f636bc16f5 execMap uses script ext to lookup. Fixes #265
+ tests
2014-01-16 22:52:39 +00:00
Remy Sharp
bfc4ac1c4d Required nodemon accepts env to pass to spawned process
See https://github.com/ChrisWren/grunt-nodemon/pull/29 for example/request
2014-01-15 14:07:36 +00:00
Remy Sharp
a5f81bd883 Fixed old nodemon ignore file support 2014-01-05 14:59:58 +00:00
Remy Sharp
a55ca022f8 Merge branch 'fix/241' of github.com:remy/nodemon into fix/241 2014-01-05 14:32:14 +00:00
Remy Sharp
a41b5632e8 assert message 2014-01-05 14:31:48 +00:00
Remy Sharp
ab549a1e85 All tests passing (damn race conditions) 2014-01-05 10:16:39 +00:00
Remy Sharp
13770da9f3 Fixed nodemon.once. Add config.run. Tests not 100% passing
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.
2014-01-05 01:42:37 +00:00
Remy Sharp
8eef00b334 Add new tests for match code and updated for monitor format. 2014-01-05 00:44:56 +00:00
Remy Sharp
e92d29316f Fixed default ignore rule overriding all 2014-01-02 18:17:26 +00:00
Remy Sharp
ab464021df 78 tests passing on mac. 2013-12-29 20:26:28 +00:00
Remy Sharp
5c7af6bfc4 More tests. 79% code coverage + more docs
- Events documented
- Require working nicely
- If nodemon is required, nodemon message are emitted rather than console.log'ged
2013-12-14 00:57:41 +00:00
Remy Sharp
417a4c6510 Now loading old style nodemonignore configs 2013-12-11 15:15:34 +00:00
Remy Sharp
999f87eeda Support for execMap #195 and tests 2013-12-10 13:29:35 +00:00
Remy Sharp
c5a5c88af7 tweaking numbers to test travis 2013-12-05 22:31:40 +00:00
Remy Sharp
48855d051f More test coverage 2013-12-05 16:29:58 +00:00