The find method wasn't known when it tries to add the directories to monitor. This change fixes that
This commit is contained in:
Remy Sharp
2015-02-10 19:22:40 +00:00
parent 53587d7380
commit 7e6fe7c945
4 changed files with 12 additions and 10 deletions

View File

@@ -57,13 +57,6 @@ config.load = function (settings, ready) {
options.watch.push('*.*');
}
options.monitor = rulesToMonitor(options.watch, options.ignore, config);
var cwd = process.cwd();
if (config.dirs.length === 0) {
config.dirs.unshift(cwd);
}
var cmd = command(config.options);
config.command = {
raw: cmd,
@@ -72,6 +65,13 @@ 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);
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;
}

View File

@@ -67,7 +67,7 @@ function rulesToMonitor(watch, ignore, config) {
// narrowing down otherwise it tries to find on the entire drive...which
// is a bit batty.
// `!not` ... sorry.
if (utils.isMac && !not) {
if (config.system.useFind && !not) {
config.dirs.push(dir);
}
} else {
@@ -77,7 +77,7 @@ function rulesToMonitor(watch, ignore, config) {
}
} catch (e) {
var base = tryBaseDir(dir);
if (utils.isMac && !not && base) {
if (config.system.useFind && !not && base) {
if (config.dirs.indexOf(base) === -1) {
config.dirs.push(base);
}

View File

@@ -27,6 +27,8 @@ module.exports = function () {
offset = 0;
}
config.offset = offset;
return offset;
};

View File

@@ -198,7 +198,7 @@ function run(options) {
/* Now kill the entire subtree of processes belonging to nodemon */
var oldPid = child.pid;
if (child) { // sometimes (when?!?) the child wonders off
if (child) {
kill(child, 'SIGUSR2', function () {
// this seems to fix the 0.11.x issue with the "rs" restart command,
// though I'm unsure why. it seems like more data is streamed in to