Commit Graph

94 Commits

Author SHA1 Message Date
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
d15cf686f7 fix: remove scoped dep
Fixes #1180
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
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
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
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
Remy Sharp
8a0ce0941f 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-10-19 12:27:53 +01:00
Remy Sharp
a3b6c3ec26 fix: allows user to not watch
Fixes #516
2015-10-19 12:27:53 +01:00
Remy Sharp
29cf71e979 fix: stdin was closed after crashed child
Fixes #601
2015-10-19 12:27:53 +01:00
Remy Sharp
03ef996d29 chore: Merge branch 'fix/package-start-with-env' 2015-09-19 10:25:50 +01:00
Kevin Woo
cde21fb4de test: added dotfile tests 2015-09-15 21:46:36 -07:00
Remy Sharp
5e07bfef85 fix: supporting env values in package.start
Before it was trying to parse the value in .start, when in fact, the entire value represents the `cmd`.

Fixes #621
Fixes #615
Fixes #577
Fixes #513
2015-09-12 22:51:02 +01:00
Remy Sharp
f7a94768f6 refactor: add debugging 2015-09-10 10:38:32 +01:00
Remy Sharp
438b8d7c0e refactor: passing jscs 2015-09-09 22:30:43 +01:00
Remy Sharp
7496f08330 fix: incorrectly exiting when required
test: updated travis tests
2015-09-09 22:29:26 +01:00
Remy Sharp
b0fd56f7de refactor: move watch out in favour of chokidar
Plus jscs clean ups
2015-08-31 18:25:55 +01:00
Remy Sharp
e177dd7865 Merge pull request #578 from khoomeister/ck-disable-startup
add option --no-startup to not run command on startup
2015-07-27 21:44:05 +01:00
Zolmeister
e89786388c monitor: always exit, fixes #592 2015-07-26 00:57:13 -07:00
Chris Khoo
50f5994ee6 change --no-startup to --on-change-only 2015-07-20 18:40:45 -07:00
Chris Khoo
db196733b7 add option --no-startup to not run command on startup 2015-07-05 16:19:11 -07:00
Remy Sharp
01bc4d0ba1 Merge pull request #515 from STRML/fixQuit
Fix nodemon.json's 'quit' listener and add test.
2015-05-19 13:28:22 +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
Samuel Reed
15751fe432 Fix nodemon.json's 'quit' listener and add test. 2015-03-02 18:44:21 +07:00
Remy Sharp
47896d9254 Fix the pattern match for windows escaping
Fixes #497
2015-02-11 15:04:31 +00:00
Remy Sharp
d984c473a2 Merge pull request #502 from remy/fix/node-0-12
Fixed #499 [skip ci]
2015-02-11 12:32:17 +00:00
Remy Sharp
10ed83ea21 Fixed #499
`rs` now works again on windows when app has crashed.
2015-02-11 12:16:16 +00:00
Remy Sharp
7e6fe7c945 Fixes #352
The find method wasn't known when it tries to add the directories to monitor. This change fixes that
2015-02-10 19:22:40 +00:00
Remy Sharp
afc646f026 Fixed #474
Support spaces in exec - the user must escape using the ^ character as per http://superuser.com/a/279121
2015-01-28 13:27:21 +00:00
tom
df006c96a7 parse cmd.args 2015-01-22 11:56:03 +08:00
Remy Sharp
51f825d341 Add test to check if passed opts are priority
Currently failing due to bug in code - THIS IS MY PLAN!
2015-01-20 14:08:11 +00:00
Remy Sharp
3feff5035e Fixed #468
My old spawn check was based on the minor value being >= 8, of course now io.js is 1.0.2, it wasn't using the new spawn method, and silencing user scripts.
2015-01-19 21:58:49 +00:00
Remy Sharp
9651ab88b0 Escape exec *args* only if space
This matches npm's functionality. It's also been tested against the "some\"file" test, etc. It's hard too...and late.
2015-01-14 22:45:45 +00:00
Remy Sharp
5f7f36c562 Fixed #454
Detect if `ps` is available, and if not, just try to kill the parent
2015-01-07 22:03:24 +00:00
Remy Sharp
b905ffae7d Fixed #448 - but failing other tests WIP
[skip ci]

Currently failing tests around handling of spaces in exec arguments.
2015-01-01 21:39:10 +00:00
Remy Sharp
c85943b76d WIP 2015-01-01 21:26:49 +00:00
Remy Sharp
da72f41e46 Fixed windows support
Except windows shutdown before I had a chance run npm test - but it work!
2014-12-09 17:09:52 +00:00
Remy Sharp
f7537533dd Use sh to spawn, allowing for complex commands
Pinched from https://github.com/npm/npm/blob/master/lib/utils/lifecycle.js#L197

By switching to using `sh` to fire up the command, it allows the user's exec command to chain unix commands together.
2014-12-09 16:26:25 +00:00
Remy Sharp
93113c9d70 Better tests for scripts with spaces 2014-12-08 18:31:25 +00:00
Remy Sharp
734986de19 Shouldn't be using strict equality 2014-12-06 15:17:49 +00:00