Skip to content

Commit

Permalink
Moved update checking to main binary
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Jan 15, 2017
1 parent 2ef125d commit 8075d8b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 10 additions & 0 deletions bin/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

// Packages
const asyncToGen = require('async-to-gen/register')
const updateNotifier = require('update-notifier')

// Ours
const pkg = require('../package')

asyncToGen({
excludes: null
})

// Let user know if there's an update
// This isn't important when deployed to Now
if (!process.env.NOW) {
updateNotifier({pkg}).notify()
}

require('../lib')
10 changes: 0 additions & 10 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ const compress = require('micro-compress')
const fs = require('fs-promise')
const auth = require('basic-auth')
const stream = require('send')
const updateNotifier = require('update-notifier')
const {copy} = require('copy-paste')

// Ours
const pkg = require('../package')

args
.option('port', 'Port to listen on', process.env.PORT)
.option('cache', 'How long static files should be cached in the browser (seconds)', 3600)
Expand All @@ -33,12 +29,6 @@ args
const flags = args.parse(process.argv)
const directory = args.sub[0]

// Let user know if there's an update
// This isn't important when deployed to Now
if (!process.env.NOW) {
updateNotifier({pkg}).notify()
}

process.env.ASSET_DIR = '/' + Math.random().toString(36).substr(2, 10)

let current = process.cwd()
Expand Down

0 comments on commit 8075d8b

Please sign in to comment.