Skip to content

Commit

Permalink
Remove update-notifier (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Feb 6, 2020
1 parent e34cb04 commit c9d3e6b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -55,7 +55,6 @@
"pino-colada": "^1.4.4",
"pump": "^3.0.0",
"resolve-from": "^4.0.0",
"update-notifier": "^2.5.0",
"yargs-parser": "^16.0.0"
},
"devDependencies": {
Expand Down
18 changes: 1 addition & 17 deletions start.js
Expand Up @@ -7,7 +7,6 @@ require('dotenv').config()
const assert = require('assert')
const path = require('path')

const updateNotifier = require('update-notifier')
const PinoColada = require('pino-colada')
const pump = require('pump')
const isDocker = require('is-docker')
Expand All @@ -17,14 +16,12 @@ const parseArgs = require('./args')
const { exit, requireFastifyForModule, requireServerPluginFromPath, showHelpForCommand } = require('./util')

let Fastify = null
let fastifyPackageJSON = null

function loadModules (opts) {
try {
const { module: fastifyModule, pkg: fastifyPkg } = requireFastifyForModule(opts._[0])
const { module: fastifyModule } = requireFastifyForModule(opts._[0])

Fastify = fastifyModule
fastifyPackageJSON = fastifyPkg
} catch (e) {
module.exports.stop(e)
}
Expand All @@ -46,19 +43,6 @@ function start (args, cb) {

loadModules(opts)

const notifier = updateNotifier({
pkg: {
name: 'fastify',
version: fastifyPackageJSON.version
},
updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week
})

notifier.notify({
isGlobal: false,
defer: false
})

if (opts.watch) {
return watch(args, opts.ignoreWatch)
}
Expand Down
3 changes: 1 addition & 2 deletions util.js
Expand Up @@ -19,9 +19,8 @@ function requireFastifyForModule (modulePath) {
try {
const basedir = path.resolve(process.cwd(), modulePath)
const module = require(resolveFrom.silent(basedir, 'fastify') || 'fastify')
const pkg = require(resolveFrom.silent(basedir, 'fastify/package.json') || 'fastify/package.json')

return { module, pkg }
return { module }
} catch (e) {
exit('unable to load fastify module')
}
Expand Down

0 comments on commit c9d3e6b

Please sign in to comment.