mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
fix: support signal on CLI (#1061)
This commit is contained in:
@@ -194,6 +194,10 @@ function nodemonOption(options, arg, eatNext) {
|
||||
options.colours = false;
|
||||
} else
|
||||
|
||||
if (arg === '--signal' || arg === '-s') {
|
||||
options.signal = eatNext();
|
||||
} else
|
||||
|
||||
if (arg === '--cwd') {
|
||||
options.cwd = eatNext();
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ describe('nodemon argument parser', function () {
|
||||
});
|
||||
|
||||
it('should support short versions of flags', function () {
|
||||
var settings = cli.parse('node nodemon -v -x java -I -V -q -w fixtures -i fixtures -d 5 -L -C -e jade');
|
||||
var settings = cli.parse('node nodemon -v -x java -I -V -q -w fixtures -i fixtures -d 5 -L -C -e jade -s SIGHUP');
|
||||
assert(settings.version, 'version');
|
||||
assert(settings.verbose, 'verbose');
|
||||
assert(settings.exec === 'java', 'exec');
|
||||
@@ -243,11 +243,12 @@ describe('nodemon argument parser', function () {
|
||||
assert(settings.delay === 5000, 'delay 5 seconds');
|
||||
assert(settings.runOnChangeOnly, 'run on change only');
|
||||
assert(settings.ext === 'jade', 'extension is jade');
|
||||
assert(settings.signal === 'SIGHUP', 'signal is SIGHUP');
|
||||
});
|
||||
|
||||
|
||||
it('should support long versions of flags', function () {
|
||||
var settings = cli.parse('node nodemon --version --exec java --verbose --quiet --watch fixtures --ignore fixtures --no-stdin --delay 5 --legacy-watch --exitcrash --on-change-only --ext jade --config my/.nodemon.json');
|
||||
var settings = cli.parse('node nodemon --version --exec java --verbose --quiet --watch fixtures --ignore fixtures --no-stdin --delay 5 --legacy-watch --exitcrash --on-change-only --ext jade --config my/.nodemon.json --signal SIGHUP');
|
||||
assert(settings.version, 'version');
|
||||
assert(settings.verbose, 'verbose');
|
||||
assert(settings.exec === 'java', 'exec');
|
||||
@@ -259,7 +260,8 @@ describe('nodemon argument parser', function () {
|
||||
assert(settings.delay === 5000, 'delay 5 seconds');
|
||||
assert(settings.runOnChangeOnly, 'run on change only');
|
||||
assert(settings.ext === 'jade', 'extension is jade');
|
||||
assert(settings.configFile === 'my/.nodemon.json', 'custom config file name is my/.nodemon.json')
|
||||
assert(settings.configFile === 'my/.nodemon.json', 'custom config file name is my/.nodemon.json');
|
||||
assert(settings.signal === 'SIGHUP', 'signal is SIGHUP');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user