refactor: remove legacy watch support

Since we're now using chokidar which has it's own internal way of switching, so we don't need to do it ourselves.
This commit is contained in:
Remy Sharp
2015-09-12 09:13:08 +01:00
parent 5b7ca93a3b
commit d675c8be09
3 changed files with 10 additions and 19 deletions

View File

@@ -12,8 +12,6 @@
-I, --no-stdin ........... don't try to read from stdin.
-C, --on-change-only ..... execute script on change only, not startup
-d, --delay n ............ debounce restart for "n" seconds.
-L, --legacy-watch ....... Forces node to use the most compatible version
for watching file changes.
--exitcrash .............. exit on crash, allows use of nodemon with daemon
tools like forever.js.
-v, --version ............ current nodemon version.
@@ -35,6 +33,6 @@
$ PORT=8000 nodemon --debug-brk server.js
$ nodemon --exec python app.py
$ nodemon --exec "make build" -e "styl hbs"
$ nodemon app.js -- -L
$ nodemon app.js -- -v
For more details see http://github.com/remy/nodemon/

View File

@@ -166,10 +166,6 @@ function nodemonOption(options, arg, eatNext) {
options.exec = eatNext();
} else
if (arg === '--legacy-watch' || arg === '-L') {
options.legacyWatch = true;
} else
if (arg === '--no-stdin' || arg === '-I') {
options.stdin = false;
} else

View File

@@ -149,22 +149,21 @@ describe('nodemon CLI parser', function () {
});
it('should keep eating arguments that are for nodemon after the script.js', function () {
var settings = parse(asCLI('--watch "foo bar" test/fixtures/app.js -V --scriptOpt1 -L -- -L'));
assert.deepEqual(settings.execOptions.args, ['--scriptOpt1', '-L'], 'script args are: ' + settings.execOptions.args.join(' '));
var settings = parse(asCLI('--watch "foo bar" test/fixtures/app.js -V --scriptOpt1 -- -V'));
assert.deepEqual(settings.execOptions.args, ['--scriptOpt1', '-V'], 'script args are: ' + settings.execOptions.args.join(' '));
assert(settings.verbose === true, 'verbose');
assert(settings.watch[0] === 'foo bar', 'watching "foo bar" dir');
assert(settings.legacyWatch, 'legacy watch method enabled');
});
it('should allow -- to appear anywhere, and still find user script', function () {
var settings = parse(asCLI('test/fixtures/app.js -- -L'));
assert(!settings.legacyWatch, '-L arg was passed to script, not nodemon');
assert.deepEqual(settings.execOptions.args, ['-L'], 'script passed -L via --');
settings = parse(asCLI('-- test/fixtures/app.js -L'));
assert.deepEqual(settings.execOptions.args, ['-L'], 'leading -- finds script');
settings = parse(asCLI('test/fixtures/app.js -L --'));
var settings = parse(asCLI('test/fixtures/app.js -- -V'));
assert(!settings.verbose, '-V arg was passed to script, not nodemon');
assert.deepEqual(settings.execOptions.args, ['-V'], 'script passed -V via --');
settings = parse(asCLI('-- test/fixtures/app.js -V'));
assert.deepEqual(settings.execOptions.args, ['-V'], 'leading -- finds script');
settings = parse(asCLI('test/fixtures/app.js -V --'));
assert.deepEqual(settings.execOptions.args, [], '-- is ignored');
assert(settings.legacyWatch, '-L was passed to nodemon');
assert(settings.verbose, '-V was passed to nodemon');
});
it('should support arguments from the cli', function () {
@@ -246,7 +245,6 @@ describe('nodemon argument parser', function () {
assert(settings.watch[0] === 'fixtures', 'watch');
assert(settings.ignore[0] === 'fixtures', 'ignore');
assert(settings.delay === 5000, 'delay 5 seconds');
assert(settings.legacyWatch, 'legacy watch method');
assert(settings.runOnChangeOnly, 'run on change only');
assert(settings.ext === 'jade', 'extension is jade');
});
@@ -263,7 +261,6 @@ describe('nodemon argument parser', function () {
assert(settings.watch[0] === 'fixtures', 'watch');
assert(settings.ignore[0] === 'fixtures', 'ignore');
assert(settings.delay === 5000, 'delay 5 seconds');
assert(settings.legacyWatch, 'legacy watch method');
assert(settings.runOnChangeOnly, 'run on change only');
assert(settings.ext === 'jade', 'extension is jade');
});