Skip to content

Commit

Permalink
fix: restore --legacy-watch
Browse files Browse the repository at this point in the history
Pass the `usePolling` flag to Chokidar when in legacy mode, which is supposed to/hopefully fix containers watching network attached drives.

Fixes #639
Fixes #633
  • Loading branch information
remy committed Sep 19, 2015
1 parent 223542e commit 489f22d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/cli/parse.js
Expand Up @@ -131,6 +131,10 @@ function nodemonOption(options, arg, eatNext) {
options.verbose = true;
} else

if (arg === '--legacy-watch' || arg === '-L') {
options.legacyWatch = true;
} else

// Depricated as this is "on" by default
if (arg === '--js') {
options.js = true;
Expand Down
2 changes: 0 additions & 2 deletions lib/config/load.js
Expand Up @@ -136,8 +136,6 @@ function normaliseRules(options, ready) {
options.watch = rules.rules.watch;
options.ignore = rules.rules.ignore;

debug('final rules', options);

ready(options);
}

Expand Down
1 change: 1 addition & 0 deletions lib/monitor/watch.js
Expand Up @@ -52,6 +52,7 @@ function watch() {
var watcher = chokidar.watch(dir, {
ignored: ignored,
persistent: true,
usePolling: config.options.legacyWatch || false,
});

var total = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/cli/parse.test.js
Expand Up @@ -39,7 +39,7 @@ describe('nodemon CLI parser', function () {
var settings = parse(asCLI('--debug'));
var cmd = commandToString(command(settings));
process.chdir(cwd);
assert(cmd === 'node --debug ./bin/www')
assert(cmd === 'node --debug ./bin/www');
});

it('should replace {{filename}}', function () {
Expand Down
1 change: 1 addition & 0 deletions test/monitor/match.test.js
Expand Up @@ -344,6 +344,7 @@ describe('match rule parser', function () {
describe('watcher', function () {
afterEach(function () {
watch.resetWatchers();
config.reset();
});

it('should match a dotfile if explicitly asked to', function (done) {
Expand Down

0 comments on commit 489f22d

Please sign in to comment.