207 Commits

Author SHA1 Message Date
Remy Sharp
33fa6f4970 fix: wrongly normalizing slashes in windows
This change takes code from npm's cli to change the way the arguments
passed to nodemon are interpreted.

Removes path.normalize and replaces with windowsVerbatimArguments

Fixes #1236
2018-02-01 22:47:56 +00:00
Remy Sharp
4cfd0b9cf8 chore: fix lint warning 2018-02-01 22:47:41 +00:00
Remy Sharp
79e61f00e7 fix: sniff for child.stdout before using it
This fixes node@6.0.0, but it's a hack, so I'm going to emit a message
saying that non-LTS is not supported.
2018-02-01 22:47:41 +00:00
Remy Sharp
4be493ca0d fix: don't ignore dot-directories
Fixes #1223
2018-01-11 11:00:46 +00:00
Remy Sharp
e90f15aa8a fix: node < 6.4.0 causing crash on 'rs' trigger
* fix: node < 6.4.0 can't connect to stdin
* fix: child stdio when spawn is similar to fork

Fixes #1218
2018-01-09 13:18:08 +00:00
Remy Sharp
e95ea6f656 fix: ignorePermissionErrors in chokidar
Make any permission errors silent, since it the most likely case we don't need them at all.

Fixes: #1213
2018-01-08 12:35:06 +00:00
Remy Sharp
c121187611 refactor: indexOf > includes (in node4) 2018-01-08 12:33:51 +00:00
Remy Sharp
8cec0fc0c7 chore: fix linting issue 2018-01-08 12:33:51 +00:00
Remy Sharp
718a9ad2e2 fix: correctly pass ignored rules to chokidar
Previous the rules weren't matching fully inside of chokidar, requiring
that, for instance, node_modules is written as **/node_modules/**.

I've also tidied up what's printed in verbose mode, so it doesn't print
default ignores, and doesn't print the full path of an ignored
directory.

This change _also_ fixes notifications from chokidar from user ignored
paths (using the `cwd` argument). This should fix #1202
2018-01-08 12:33:51 +00:00
Remy Sharp
6e7ce4bbe2 fix: swallow child.stdin err
This is a weird case where stdin isn't fully connected and throws in
ubuntu 16.04 (replicated in a Docker image).

Fixes #1195
2017-12-31 19:47:16 +00:00
Remy Sharp
0d9a89241c fix: don't use fork with node inspect
Fixes: #1191
2017-12-29 11:07:04 +00:00
Remy Sharp
5a914cb35b fix: handle exit(2) better 2017-12-29 10:55:12 +00:00
Remy Sharp
f711537795 chore: fix linting 2017-12-29 10:54:48 +00:00
Remy Sharp
7a04e2c71f fix: incorrect count of watch files being reported
The number of watched files was correct, but showed (incorrectly) a
cumulative total of watched files (i.e. 1 + 2 + 3 + 4 etc).

Fixes #1194
2017-12-29 10:54:48 +00:00
Remy Sharp
4589bc8a60 fix: properly ignore defaults, don't match partial
Changed to passing Chokidar simple strings instead of custom regexp, only had to prefix with **/ to get it to match the ignore directories properly.

Fixes #916
2017-12-20 23:21:35 +00:00
Remy Sharp
1d88943394 fix: pass stdin to child process on -I
Fixes #1036 - the no-stdin wasn't passing the process.stdin to the
child.
2017-12-20 23:21:06 +00:00
Remy Sharp
1e2516de4a fix: defined diretory watching 2017-12-20 14:09:14 +00:00
Remy Sharp
d15cf686f7 fix: remove scoped dep
Fixes #1180
2017-12-20 14:09:03 +00:00
Remy Sharp
67d146637e refactor: remove libraries over native es6 support 2017-12-20 14:09:03 +00:00
Remy Sharp
1171fc1a9a fix: nodemon reporting crash
Fixes #1173
2017-12-16 01:17:47 +00:00
Remy Sharp
bd9d5957bf chore: fix linting issues 2017-12-15 15:20:01 +00:00
Remy Sharp
e9129c03f8 fix: switch to killing using numericals
Fixes #956
Fixes #813
2017-12-15 15:05:20 +00:00
Remy Sharp
bf9b7a6876 fix: if no ps, walk /proc to kill child fully
Originally used ps-tree which relied on `ps` on *nix. But if the system
didn't have `ps` at all, we'd try to kill the child process, but alas
this would not always work, as we're spawning `sh` and _then_ node, so
the kill would only kill the `sh` process, and not the running node
process.

The new @remy/pstree lib sniffs for `ps` and defers to ps-tree,
otherwise it will walk /proc and map the PPID to the child process
allowing nodemon to fully clean up.
2017-12-15 14:14:26 +00:00
Martin Dimitrov
10ded94cd7 fix: fixed an issue where we tried to resolve null as path 2017-12-15 14:14:17 +00:00
Remy Sharp
f8a5abe258 feat: watch script regardless of extension
Fixes the issue where express is a js based project, but the executable
is `www`, so it misses on the match. So now nodemon will watch for
matching extensions but *also* the script the user gave.

Fixes #461

Note that this can't handle the situation where npm is used to run `node
./bin/www` as nodemon can't split out a package script command.
2017-12-15 08:46:11 +00:00
Remy Sharp
fd961d6053 fix: defensive check on accessing cmd.args 2017-12-13 22:17:13 +00:00
Remy Sharp
d9e93ad367 fix: support node arguments again
If node is being passed any arguments (before the script) then use
spawn instead of fork.

Fixes #1161
2017-12-13 21:08:33 +00:00
Remy Sharp
f52615c0f7 fix: only use fork if node>4 2017-12-13 13:08:05 +00:00
Timothy Huang
cf923a8a77 fix: get tests to pass 2017-12-06 14:45:17 -08:00
Tim
f711fb7889 test: fork child node processes 2017-12-06 14:45:10 -08: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
Remy Sharp
24a4b84717 feat: disable chokidar globbing on windows (#1140)
Fixes a range of issues, including:

Fixes #1115

* refactor: use Object.assign in place of merge (this will leak to more work)

Since we're now supporting 6 upwards
2017-12-04 20:05:58 +00:00
Remy Sharp
6d57dac0ee fix: bump deps and fix tests for local dev (#1139)
Upgraded tests for node 8
2017-12-04 14:56:44 +00:00
GerA
469fa80aa7 fix: crash when passing argument to node (windows)
Fixes #1095
2017-09-15 07:40:25 +01:00
Brian Dentino
facc8cb2c7 fix: exit with code 1 on crash if --exitcrash (#946)
I'm using nodemon in a docker container with a restart policy configured to restart the container in case it crashes. If the app crashes, nodemon exits with code 0 and docker assumes it was a graceful exit, so it does not restart my container. I don't see the harm in changing the exit code here to reflect an unexpected termination, given that this path is only exercised in the event of a crash.
2017-09-04 20:16:40 +01:00
Attila Hajdrik
481dc8f8ef fix: executable path handling under windows (#962)
- If the user configured a *nix compatible npm script where the path contained a forward slash, that failed under windows, since cmd.exe treated that as a command line argument.
- The quote handling was not 100% correct under windows, the whole path needs to be quoted, not just the segments it is also modified.
2017-09-04 19:47:52 +01:00
Marc Trudel
2cd85b1f60 feat: add support for customisable signal 2016-10-06 19:52:41 +01:00
Remy Sharp
be5d4e8d13 fix: revert 'inherit' on stdin
Fixes #894
Fixes #895

I'll have to continue investigation as to how we deal with spawned clients setting raw on stdin. Will break #890 and https://github.com/FormidableLabs/webpack-dashboard/issues/16
2016-08-18 22:04:42 +01:00
Remy Sharp
58a236e0ce fix: use stdin=inhert on vanilla run
* fix: non-utf8 stdin processing
Fixes #890
Ref https://github.com/FormidableLabs/webpack-dashboard/issues/16

The library blessed inside of the webpack-dashboard does some funky stuff with std streams and the expectation of the encoding. I'm not 100% sure of this change, I've got to see all the tests, but this tweak moves to inherit the child's stdin and doesn't purposely encode the stdin stream as utf8 (which, I don't recall exactly why I did this in the first place…though I'm fairly sure it was another issue somewhere else in nodemon).
* fix: use stdin:inherit when we're not forked
* fix: don't use inherit when required
* style: lint
* style: I am going to 🐎 kick the lint in the 🌰
2016-08-18 15:54:39 +01:00
Mark Wubben
7152585fa2 fix: don't concatenate ignore regexes
The initial `ignored` may be undefined. If it isn't then a pipe character should
be inserted. This is all unnecessary though if we build up an array like before
4826c87744.
2016-02-25 21:08:44 +00:00
Danny Raetzsch
fc2bc168b0 feat: support --polling-interval command line arg 2015-11-09 20:34:43 -06:00
Sergey Slipchenko
7e7dc0402e Save readiness state on a per-watcher basis 2015-10-22 22:24:06 +03:00
Remy Sharp
2f19ffb5a7 fix: restart on new files added to watched dir
Fixes #664

Also includes tests and quietens the force crash test (though unchanged).
2015-10-19 12:34:38 +01:00
Remy Sharp
931d50050d fix: rs to restart
Always unhook the process.stdin when the child has exited, this allows the `rs` command to be read - otherwise it's ignored.

Fixes #648
2015-09-23 08:34:38 +01:00
Remy Sharp
6a5397e166 fix: allows user to not watch
Fixes #516
2015-09-21 11:24:16 +01:00
Remy Sharp
d817866eab fix: stdin was closed after crashed child
Fixes #601
2015-09-19 16:15:03 +01:00
Remy Sharp
a3c9356de7 chore: Merge branch 'feature/better-error-on-watch-bork' 2015-09-19 10:47:37 +01:00
Remy Sharp
d98301d436 chore: Merge branch 'feature/legacy-polling-mode'
Conflicts:
	test/cli/parse.test.js
2015-09-19 10:43:08 +01:00
Remy Sharp
2e80f9bef7 chore: Merge branch 'master' into feature/better-error-on-watch-bork 2015-09-19 10:29:38 +01:00
Remy Sharp
03ef996d29 chore: Merge branch 'fix/package-start-with-env' 2015-09-19 10:25:50 +01:00