Skip to content

Commit

Permalink
fix: incorrectly exiting when required
Browse files Browse the repository at this point in the history
test: updated travis tests
  • Loading branch information
remy committed Sep 9, 2015
1 parent 309423a commit 7496f08
Show file tree
Hide file tree
Showing 25 changed files with 274 additions and 484 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
@@ -0,0 +1,22 @@
FROM ubuntu:12.04
MAINTAINER Remy Sharp <remy@leftlogic.com>

RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get update && apt-get install curl npm -y

ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION iojs
ENV NVM_VERSION 0.26.1
ENV TRAVIS TRUE

# # Install nvm with node and npm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v$NVM_VERSION/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install 0.10 \
&& nvm install 0.12 \
&& nvm install iojs-v1 \
&& nvm install iojs-v2 \
&& nvm install iojs-v3 \
&& nvm install 4.0 \
&& nvm alias default $NODE_VERSION \
&& nvm use default
4 changes: 0 additions & 4 deletions lib/cli/parse.js
Expand Up @@ -126,10 +126,6 @@ function nodemonOption(options, arg, eatNext) {
options.dump = true;
}

else if (arg === '--no-vm') {
options.novm = true;
}

else if (arg === '--verbose' || arg === '-V') {
options.verbose = true;
}
Expand Down
70 changes: 0 additions & 70 deletions lib/config/checkWatchSupport.js

This file was deleted.

20 changes: 7 additions & 13 deletions lib/config/index.js
Expand Up @@ -10,7 +10,6 @@ var utils = require('../utils');
var command = require('./command');
var rulesToMonitor = require('../monitor/match').rulesToMonitor;
var bus = utils.bus;
var checkWatchSupport = require('./checkWatchSupport');

function reset() {
rules.reset();
Expand Down Expand Up @@ -66,20 +65,15 @@ config.load = function (settings, ready) {
};

// now run automatic checks on system adding to the config object
checkWatchSupport(config, function (config) {
options.monitor = rulesToMonitor(options.watch, options.ignore, config);
options.monitor = rulesToMonitor(options.watch, options.ignore, config);

var cwd = process.cwd();
if (config.dirs.length === 0) {
config.dirs.unshift(cwd);
}
var cwd = process.cwd();
if (config.dirs.length === 0) {
config.dirs.unshift(cwd);
}

if (config.system.useFind === false && config.system.useWatch === false) {
config.system.useWatchFile = true;
}
bus.emit('config:update', config);
ready(config);
});
bus.emit('config:update', config);
ready(config);
});
};

Expand Down
1 change: 1 addition & 0 deletions lib/config/load.js
@@ -1,3 +1,4 @@
var debug = require('debug')('nodemon');
var fs = require('fs');
var path = require('path');
var exists = fs.exists || path.exists;
Expand Down
82 changes: 0 additions & 82 deletions lib/config/watchable.js

This file was deleted.

57 changes: 0 additions & 57 deletions lib/monitor/changed-since.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/monitor/index.js
@@ -1,5 +1,4 @@
module.exports = {
run: require('./run'),
watch: require('./watch'),
offset: require('./offset'),
};
44 changes: 0 additions & 44 deletions lib/monitor/offset.js

This file was deleted.

10 changes: 9 additions & 1 deletion lib/monitor/run.js
@@ -1,3 +1,4 @@
var debug = require('debug')('nodemon');
var utils = require('../utils');
var bus = utils.bus;
var childProcess = require('child_process');
Expand Down Expand Up @@ -132,6 +133,7 @@ function run(options) {

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

// exit the monitor, but do it gracefully
Expand Down Expand Up @@ -217,6 +219,12 @@ function run(options) {
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.pipe(child.stdin);

bus.once('exit', function () {
if (child && process.stdin.unpipe) { // node > 0.8
process.stdin.unpipe(child.stdin);
}
});
}

watch();
Expand Down Expand Up @@ -280,10 +288,10 @@ bus.on('quit', function onQuit() {
listener();
}
});
process.exit(0);
} else {
bus.emit('exit');
}
process.exit(0);
};

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

0 comments on commit 7496f08

Please sign in to comment.