Skip to content

Commit

Permalink
CLI: add update-notifier. Fixes #1805 (#1890)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebidel committed Mar 24, 2017
1 parent ee732bf commit 44a2d3b
Show file tree
Hide file tree
Showing 3 changed files with 408 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lighthouse-cli/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ import * as randomPort from './random-port';
import {Results} from './types/types';
const yargs = require('yargs');
const opn = require('opn');
const updateNotifier = require('update-notifier');
const pkg = require('../package.json');

updateNotifier({pkg}).notify(); // Tell user if there's a newer version of LH.

interface LighthouseError extends Error {
code?: string
};

const cliFlags = yargs
.help('help')
.version(() => require('../package').version)
.version(() => pkg.version)
.showHelpOnFail(false, 'Specify --help for available options')

.usage('$0 url')
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"typescript": "^2.2.0"
},
"dependencies": {
"@types/node": "^6.0.45"
"@types/node": "^6.0.45",
"update-notifier": "^2.1.0"
}
}
Loading

0 comments on commit 44a2d3b

Please sign in to comment.