fix: properly handle --no-update-notifier

This commit is contained in:
Remy Sharp
2017-12-29 10:23:23 +00:00
parent c63771726c
commit 48048aaf12
2 changed files with 12 additions and 7 deletions

View File

@@ -1,16 +1,16 @@
#!/usr/bin/env node
'use strict';
var cli = require('../lib/cli');
var nodemon = require('../lib/');
var options = cli.parse(process.argv);
const cli = require('../lib/cli');
const nodemon = require('../lib/');
const options = cli.parse(process.argv);
nodemon(options);
var fs = require('fs');
const fs = require('fs');
// checks for available update and returns an instance
var pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json'));
const pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json'));
if (pkg.version.indexOf('0.0.0') !== 0) {
if (pkg.version.indexOf('0.0.0') !== 0 && options.noUpdateNotifier !== true) {
require('update-notifier')({ pkg }).notify();
}

View File

@@ -113,6 +113,11 @@ function nodemonOption(options, arg, eatNext) {
options.version = true;
} else
if (arg === '--no-update-notifier') {
options.noUpdateNotifier = true;
} else
if (arg === '--dump') {
options.dump = true;
} else