From 48048aaf1261230f0c07d72ed2bd6933b7993248 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Fri, 29 Dec 2017 10:23:23 +0000 Subject: [PATCH] fix: properly handle --no-update-notifier --- bin/nodemon.js | 14 +++++++------- lib/cli/parse.js | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/nodemon.js b/bin/nodemon.js index 4676707f..31aff345 100755 --- a/bin/nodemon.js +++ b/bin/nodemon.js @@ -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(); } diff --git a/lib/cli/parse.js b/lib/cli/parse.js index 789fe6ea..4c0fa8fc 100644 --- a/lib/cli/parse.js +++ b/lib/cli/parse.js @@ -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