Skip to content

Commit

Permalink
Let user know if there's an update
Browse files Browse the repository at this point in the history
This closes #67
  • Loading branch information
leo committed Jan 12, 2017
1 parent 6dd508b commit a990173
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions bin/serve
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const compress = require('micro-compress')
const fs = require('fs-promise')
const auth = require('basic-auth')
const stream = require('send')
const updateNotifier = require('update-notifier')

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

args
.option('port', 'Port to listen on', process.env.PORT)
Expand All @@ -32,6 +36,12 @@ 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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"micro": "^6.1.0",
"micro-compress": "^1.0.0",
"mime-types": "^2.1.12",
"send": "^0.14.1"
"send": "^0.14.1",
"update-notifier": "^1.0.3"
}
}

0 comments on commit a990173

Please sign in to comment.