Commit Graph

221 Commits

Author SHA1 Message Date
Remy Sharp
fa7826a2ac Fixed event binding to nodemon not bus 2015-01-16 17:36:25 +00:00
Remy Sharp
65d2d49120 Merge branch 'master' into feature/pre-post-events 2015-01-16 10:07:03 +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
0f4ff3ffb4 Ditch trottle for debouce & fix tests 2015-01-09 21:05:36 +00:00
Remy Sharp
6415b1ecb3 Merge branch 'master' into fix/419-vm-time-offset 2015-01-08 12:46:22 +00:00
Remy Sharp
fd54d04074 Always ensure find ref file is removed 2015-01-08 12:45:57 +00:00
Remy Sharp
b4be4bffe2 Remove logging + swallow error properly 2015-01-08 12:42:13 +00:00
Remy Sharp
c223bfe5d5 Find on linux and detect container offset
Closes #455
Closes #453
Fixes #419

This method creates a file and checks the stat to check of an offset between the date on the machine and the created time on the file system. Docker (in my tests) show that you can get the offset using this method.

Once we have the offset, we tell the user (once) and then we use that to find files that have been modified according to the offset (either looking in the last using -mmin or in the future using -newer + a touched file).
2015-01-08 12:35:58 +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
8d08b183a1 Fixed nodemon require reset fully
And related events test
2015-01-07 21:45:14 +00:00
Remy Sharp
b09a37f2e8 Fixed "watching extension: undefined" 2015-01-07 21:45:14 +00:00
Edgar Hipp
308f71ac3a updating files to match nodemons syntax style 2015-01-06 12:23:08 +01:00
Edgar Hipp
5b3fb19ffe using throttle only if config.options.delay>0 2015-01-06 10:56:58 +01:00
Edgar Hipp
986ef40c29 added trailing: false to throttle
If trailing is not set to false, a setTimeOut is called if you call the
function when it is 'locked', so you need to set trailing to false to
avoid that unnecessary call
2015-01-05 17:15:47 +01:00
Edgar Hipp
ef5ee96129 changed --delay option: it now works like a throttle instead of with
setTimeout.

This changes the behaviour of the option --delay n

This means that as soon as one file changes, nodemon will restart the
script. The previous behavior was to wait for n seconds before
restarting the process. With throttle, the function gets called when the
first file changes. After that, all file changes in the interval [t,t+n]
are ignored
2015-01-05 15:48:14 +01:00
Remy Sharp
69715211d0 Merge branch 'master' into feature/pre-post-events 2015-01-03 15:49:16 +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
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
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
6f6d7ae496 Early support for event callbacks
Allows user to have event handlers in the nodemon config, such as:

{
  "events": {
    "crash": "say 'your app crashed'",
    "start": "echo 'App started' | tee app.log"
  }
}
2014-12-09 22:56:02 +00:00
Remy Sharp
1d06accf4d Merge branch 'master' into feature/pre-post-events 2014-12-09 22:27:26 +00:00
Remy Sharp
818594c902 WIP 2014-12-09 22:27:03 +00:00
Remy Sharp
b20bd8b3af More windows fixes 2014-12-09 20:35:06 +00:00
Remy Sharp
283998b340 watcher.close for watchFile doesn't exist 2014-12-09 20:20:19 +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
ca22d8d835 Merge branch 'master' into feature/pre-post-events 2014-12-09 15:01:07 +00:00
Remy Sharp
8e3ba1c662 Fixed string interpolation with array exec 2014-12-09 12:24:50 +00:00
Remy Sharp
30a0603744 nodemon api support array for exec + tests 2014-12-09 11:25:37 +00:00
Remy Sharp
80e8f7598f Early testing for event tests 2014-12-09 11:09:29 +00:00
Remy Sharp
93113c9d70 Better tests for scripts with spaces 2014-12-08 18:31:25 +00:00
Remy Sharp
acf4d61c79 Correctly parse exec when there's spaces
Closes #418
Closes #419

This version will handle quoted entities in the exec string or escaped spaces correctly, so the user can run:

--exec '"/bin/my cool app" {{filename}}'

Or

--exec '/bin/my\ cool\ app {{filename}}'

This will work both on the command line and from the API.
2014-12-08 09:16:16 +00:00
Remy Sharp
6adea0e893 Tests to show failing support 2014-12-08 08:31:47 +00:00
Remy Sharp
9cde007226 Merge pull request #430 from remy/fix/rs-restart
Shouldn't be using strict equality
2014-12-06 15:21:50 +00:00
Remy Sharp
734986de19 Shouldn't be using strict equality 2014-12-06 15:17:49 +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
785de296e4 Merge branch 'master' of https://github.com/rosshettel/nodemon into rosshettel-master 2014-12-05 11:17:55 +00:00
Remy Sharp
8565fd05d3 Revert "TESTING Revert "Find command optimization""
This reverts commit b459b6bf68.
2014-12-05 10:19:29 +00:00
Remy Sharp
1fba4fb26e Put @arty-name's fix back in
Still just testing - and ensuring the fix is solid across platforms.

TODO: revert *back in* the mac find changes
2014-12-05 10:15:15 +00:00
Remy Sharp
62757d2edc Pushing failing test
Trying out on linux platform - expecting a failed test
2014-12-05 10:10:52 +00:00
Remy Sharp
b459b6bf68 TESTING Revert "Find command optimization"
This reverts commit ba7c59ceb7.
2014-12-05 10:10:02 +00:00
Remy Sharp
6af96ec4c4 Merge branch 'patch-1' of https://github.com/arty-name/nodemon into arty-name-patch-1 2014-12-05 09:26:02 +00:00
Remy Sharp
f9e056b650 Don't follow symlinks on stat
Fixes #395 (somehow I fucked up the merge)
2014-12-05 09:19:53 +00:00
Remy Sharp
96bd4b3e79 Fixed tests on Mac
Specifically race conditions where the child process was being left running still
2014-12-04 22:07:34 +00:00
Remy Sharp
c035bc7824 Merge branch 'prune-improvement' of github.com:errendir/nodemon into errendir-prune-improvement 2014-12-04 13:22:02 +00:00
Remy Sharp
12c2e2b169 Tidy code to match coding style 2014-12-04 13:20:28 +00:00
Remy Sharp
768fe5fb29 Merge branch 'master' of github.com:JixunMoe/nodemon into JixunMoe-master 2014-12-04 13:18:34 +00:00
Remy Sharp
b839e0f043 Merge pull request #369 from momow/changedSince-fix
Fix never restarting the application if a --watch argument is a file
2014-12-04 13:07:55 +00:00
Remy Sharp
7b2b96bf8b Don't echo when we're done 2014-12-02 13:04:36 +00:00