404 Commits

Author SHA1 Message Date
Remy Sharp
6c6cb65317 fix: windows 8 doesn't support windows-kill
Fixes #1876
2021-07-08 15:48:16 +01:00
Remy Sharp
3242215ec4 fix: allow windows users to install globally again (#1874)
Fixes: #1872
2021-06-30 13:57:24 +01:00
Finn Kumkar
500c1b06e8 fix: add support for SIGINT on Windows (fixes issue #1720) (#1853)
Smashing work by @countzero ❤️
2021-06-24 22:02:46 +01:00
Remy Sharp
ac0b55e50a fix: redirect help (#1825)
Fixes: #1807

Allows for nodemon --help > help.txt
2021-01-06 14:59:30 +00:00
Remy Sharp
03c4ed3b76 fix: ignore ./<path> on cwd (#1787)
Fixes: #1784

This fixes the watch/ignore rules where the config is ignoring
the relative local path of ./ - this fix was in place for the
positive (watch) test but not patched for the negative (ignore).
2020-10-19 19:19:11 +01:00
Chakradhar Palaparthi
7e00a30d31 fix: runOnChangeOnly=true
Fxies issue #1742: corrected run.js, run.test.js, watch.js for the use case runOnChangeOnly=true (#1751)
2020-10-04 20:37:50 +01:00
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
Remy Sharp
33ae6dae33 test: fix failing test when required
I suspect, though not 100% sure, that this test fails because it was
being required and when so, chokidar is already watching and thus fires
before the config is loaded.
2020-04-08 17:55:50 +01:00
Concision
9bd07eb5b0 docs: changed verbose logging and CLI documentation to reflect support single file watch functionality 2020-01-22 16:07:18 +00:00
Remy Sharp
496c3353c4 chore: undo change to spawn code 2019-12-04 16:09:33 +00:00
Remy Sharp
47dfb8be3f fix: pipe stderr correctly
Fixes #1638

This also simplifies the shutdown process by sending the kill signal to
the sub-process - thus ensuring we don't get the weird "User defined
singal" from the shell.

This commit also includes a test to ensure this doesn't happen again.
2019-12-04 15:07:27 +00:00
Remy Sharp
ed91703f08 fix: ubuntu loop waiting for sub processes
Fixes #1633

Multiple parts but all localised to run.js:

- Refactor the kill logic to be simpler
- Consistently use pstree to determine sub process list
- Pipe stderr through nodemon to squash `sh -c` error warning

Bug was caused by waiting on multiple sub processes and if they all
ended the logic would only subtract one from the count list (rather
than the total number).

I've refactored the code so that it doesn't use the `kill -0 <pid>` as
this was a little confusing to read (it's effectively a no op) and
switched to using pstree to test if any sub processes are still running.

The logic for killing the processes has also been refactored to
simplify. Before it would fork the logic based on whether `ps` existed
on the system.

Now it uses the same logic with the exception of the kill signal sent -
when `ps` isn't on the system, we have to send numeric signals (I can't
remember how I found that out, but I do remember it was a painful
process!).

The last part required due to a side effect of the refactor on kill:
when a kill signial is sent to `sh -c` the shell prints a warning.
Details on how to replicate: https://git.io/Je6d0

To squash this, I track if the process is about to be killed (by
flagging the sub process right before the kill function call) and if
there's an error whilst shutdown is in effect, the error is only printed
to nodemon's detailed output (using nodemon -V).
2019-11-22 13:01:31 +00:00
Marcel Kottmann
0e6ba3ce6d fix: wait for all subprocesses to terminate (fixes issue #1476) 2019-11-20 15:16:55 +00:00
Aurélio A. Heckert
7d6c1a88a1 fix: Replace jade references by pug
close #1595
2019-10-15 19:27:50 -04:00
Remy Sharp
d5b98915eb test: ensure ignore relative paths
(when asked)
2019-10-07 18:11:43 +01:00
Tarmo Aidantausta
eead311749 fix: to avoid confusion like in #1528, always report used extension 2019-09-29 11:01:52 +01:00
Remy Sharp
12b66cd492 fix: langauge around "watching" (#1591)
ref: #1583

It was unclear whether it was listing files being watched when in fact
it was the list of directories (plus, make it cleaner)
2019-09-03 11:54:44 +01:00
Remy Sharp
5124ae9528 Merge branch 'master' of github.com:remy/nodemon
* 'master' of github.com:remy/nodemon:
  chore: adding funding file
  chore: update stalebot
  feat: add message event
  fix: disable fork only if string starts with dash
  feat: add TypeScript to default execPath (#1552)
  fix: Quote zero-length strings in arguments (#1551)
2019-05-25 19:26:24 +01:00
Remy Sharp
13afac22a3 fix: ensure signal is sent to exit event 2019-05-08 15:01:50 +01:00
Emily Marigold Klassen
20ccb623c4 feat: add message event
add event to listen to messages coming from the child's ipc events, partially implementing #1519
2019-05-01 08:05:47 +01:00
Emily Marigold Klassen
886527f1f0 fix: disable fork only if string starts with dash
fixes #1554
2019-05-01 08:05:18 +01:00
Leonardo Dino
64b474e9f3 feat: add TypeScript to default execPath (#1552)
`ts-node` is the standard for running typescript node programs on development mode.

Adding this line will enable everyone with a `tsconfig.json` to have a full-refresh server watching experience. (:
2019-05-01 08:04:44 +01:00
Emily Marigold Klassen
2973afbd26 fix: Quote zero-length strings in arguments (#1551)
If a zero-length string is passed, it does not get properly quoted, and then it is not properly passed to the child process
2019-05-01 08:04:25 +01:00
Remy Sharp
dd0b96a943 fix: rs in node@11 (#1493)
Fixes node 11's `rs` support. Somehow required that the `process.stdin` to be disconnected from the child before the stream is resumed (whereas previously it seemed that it would automatically happen…possibly a node 11 bug).

Fixes #1493
2018-12-14 17:43:18 +00:00
Remy Sharp
21e052eddf fix: upgrade pstree to remove vulnerability
Fixes #1463
Fixes #1469
Fixes #1464 

Completely removes the old method of `pstree[.remy]` and drops the event-stream vuln at the same time.
2018-11-27 08:45:11 +00:00
Aaron Jensen
521eb1e49d fix: restart on change for non-default signals (#1409) (#1430)
Fixes #1409
2018-11-05 11:23:14 +00:00
Damián Nohales
5a47a32f79 fix: properly pass options to chokidar 2018-08-29 18:47:51 +01:00
Paul "Joey" Clark
11ef298303 fix: smarter handling of exit code 2
Only exit after code 2 if it happened quickly; improve messaging (recommend `||exit 1`)

If nodemon exits _quickly_ on code 2, then it'll bail and warn. If it's after ~500ms, then it assumes that the sub-process intentionally used exit 2 (like mocha or stylelint), it won't bail and treat it as a failure (like a crash).

Props to @joeytwiddle

Fixes #496 
Fixes #627
2018-07-17 19:23:25 +01:00
Remy Sharp
363891ff3d fix: revert stdin handling
Fixes #1389
Fixes #1390
Ref #1386

Means that ctrl^l does not instantly clear the terminal. It requires a
new line directly after.
2018-07-13 20:21:46 +01:00
Remy Sharp
25a181351f fix: send proper quit signal on ctrl-c (#1387)
Fixes #1386

Also sends the correct signal codes on exit - so instead of $?=1 on
ctrl-c, you'll see $?=130 as per http://tldp.org/LDP/abs/html/exitcodes.html
2018-07-11 12:51:35 +01:00
Remy Sharp
a974892eae feat: support ctrl+l to clear
And refactor the stdin handling
2018-07-10 18:41:45 +01:00
Remy Sharp
d48a482b47 fix: don't watch directory when watching file
Fixes #1320

Also refactors the fix for #1259
2018-07-10 18:40:48 +01:00
Remy Sharp
9d1a63c6a6 fix: allow watching relative path files (#1385)
Fixes #1355
2018-07-10 18:39:53 +01:00
Remy Sharp
b3fc3a9aa9 fix: in watch, use fully filtered ignore rules
Fixes #1348
2018-05-23 08:15:55 +01:00
Remy Sharp
58b82f2b72 fix: increase perf of watching large file count
Fixes #1317

Originally a new Set was generated upon every individual file (or dir)
watched. This typically doesn't take a long time, but if there's 10,000
files to watch, it's very, very slow. Moving this logic out to the ready
event instead, cuts all the processing time of the watch right down.
2018-05-05 20:18:16 +01:00
Victor Perez
f616258669 fix: {{filename}} is only replaced once 2018-05-05 20:17:54 +01:00
Remy Sharp
97f8d0a175 fix: node_modules watched off relative path (#1328)
* chore: bump chokidar to latest
* test: fix weird output on restart filename
* test: skip old broken test
* fix: node_modules watched off relative path

Fixes #1294
Fixes #1305 (though couldn't confirm - just looks very similar)

I've gone back and forth on this Chokidar option `cwd` and in this fix
I've removed it from the config. I've checked the issues that were
raised that caused me to add the option, and they still appear to pass
in the tests, so I believe it's okay.

However, it _might_ come back in - just a note for Future @remy.
2018-05-05 20:17:21 +01:00
Remy Sharp
9bbc219fd5 fix: only hook SIGINT on boot - not at require
Fixes #1326
2018-05-05 20:16:37 +01:00
Remy Sharp
aa18c806b3 fix: don't throw when required in the repl
Fixes #1292
2018-03-31 08:40:08 +01:00
Remy Sharp
89d6062c68 fix: prevent throw when args missing (#1288)
Fixes #1286
2018-03-13 21:46:20 +00:00
Remy Sharp
372e6b23fc fix: watch count regression (#1287)
* chore: revert package
* fix: move to array of watched dirs

Instead of individually listing them.

Fixes #1283
2018-03-13 21:45:50 +00:00
Remy Sharp
85ed19d69a fix: throwing exeception on run
Fixes #1276

Due to const being used.
2018-02-27 17:34:28 +00:00
Remy Sharp
7fb365d0cc feat: try to resolve exec in node_modules/.bin (#1275)
Fixes #1268
2018-02-27 16:44:14 +00:00
Remy Sharp
7ffd5454ed fix: windows exec resolution (#1274)
Fixes #1251
2018-02-27 16:43:20 +00:00
Remy Sharp
94b526f80a fix: put windows drive letter tweak in right place (#1272)
Fixes #1263
2018-02-27 16:42:51 +00:00
Remy Sharp
e41f3c3aad feat: feed args to exec when detecting script (#1273)
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
2018-02-27 16:42:32 +00:00
Remy Sharp
f4391d4ff1 fix: make clear where more opts are in help (#1271) 2018-02-27 16:42:20 +00:00
Remy Sharp
1cda8fae43 fix: ensure directories are watched, not files (#1260)
Fixes #1259
2018-02-19 16:49:55 +00:00
Remy Sharp
88954455be fix: make watch & ignore relative (#1253)
* docs: add sponsors

[skip ci]

* fix: make watch & ignore relative

Fixes #1246

* fix: relative parent watching and ignore

* chore: lint

* test: fix bail on options
2018-02-15 21:57:47 +00:00
Remy Sharp
5e88b04eaa feat: add support for --spawn (#1249)
* docs: add sponsors

[skip ci]

* feat: add support for `--spawn`

Fixes #1245

* docs: remove "simply"
2018-02-15 21:57:30 +00:00