mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
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:
@@ -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/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user