Skip to content

Commit

Permalink
fix: properly handle --no-update-notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Dec 29, 2017
1 parent c637717 commit 48048aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bin/nodemon.js
Original file line number Diff line number Diff line change
@@ -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();
}
5 changes: 5 additions & 0 deletions lib/cli/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48048aa

Please sign in to comment.