Skip to content

Commit 48048aa

Browse files
committed
fix: properly handle --no-update-notifier
1 parent c637717 commit 48048aa

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

bin/nodemon.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env node
2-
'use strict';
3-
var cli = require('../lib/cli');
4-
var nodemon = require('../lib/');
5-
var options = cli.parse(process.argv);
2+
3+
const cli = require('../lib/cli');
4+
const nodemon = require('../lib/');
5+
const options = cli.parse(process.argv);
66

77
nodemon(options);
88

9-
var fs = require('fs');
9+
const fs = require('fs');
1010

1111
// checks for available update and returns an instance
12-
var pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json'));
12+
const pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json'));
1313

14-
if (pkg.version.indexOf('0.0.0') !== 0) {
14+
if (pkg.version.indexOf('0.0.0') !== 0 && options.noUpdateNotifier !== true) {
1515
require('update-notifier')({ pkg }).notify();
1616
}

lib/cli/parse.js

+5
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ function nodemonOption(options, arg, eatNext) {
113113
options.version = true;
114114
} else
115115

116+
if (arg === '--no-update-notifier') {
117+
options.noUpdateNotifier = true;
118+
} else
119+
120+
116121
if (arg === '--dump') {
117122
options.dump = true;
118123
} else

0 commit comments

Comments
 (0)