-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notify user when has a new version #107
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ import shell from 'shelljs'; | |
import chalk from 'chalk'; | ||
import ora from 'ora'; | ||
import spawn from 'cross-spawn-promise'; | ||
import updateNotifier from 'update-notifier'; | ||
|
||
import pkg from '../package.json'; | ||
|
||
const tic = chalk.green('✓'); | ||
const tac = chalk.red('✗'); | ||
|
@@ -40,3 +43,7 @@ export const verifyYeoman = async () => { // eslint-disable-line import/prefer-d | |
|
||
return true; | ||
}; | ||
|
||
export const verifyVersion = async () => { // eslint-disable-line import/prefer-default-export | ||
return await updateNotifier({pkg}).notify(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That way the notification will only work for the I also happened to run into an issue by trying to use |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need for the
eslint-disable-line
comment, it will no longer throw an error on this file since there are two exports, it's better to remove both of the comments.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, since it is a one-line function, use a shorthand removing the async/await, brackets & return syntaxes.