-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add ability to bypass isNpm check with shouldNotifyInNpmScript
option
#127
Add ability to bypass isNpm check with shouldNotifyInNpmScript
option
#127
Conversation
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.
This new option should be documented over here: https://github.com/yeoman/update-notifier#options
Can you fix the merge conflict? |
index.js
Outdated
@@ -38,6 +38,7 @@ class UpdateNotifier { | |||
this.callback = options.callback || (() => {}); | |||
this.disabled = 'NO_UPDATE_NOTIFIER' in process.env || | |||
process.argv.indexOf('--no-update-notifier') !== -1; | |||
this.skipIsNpmCheck = options.shouldNotifyInNpmScript; |
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.
Better to give it the same name in both places:
this.shouldNotifyInNpmScript = options.shouldNotifyInNpmScript;
shouldNotifyInNpmScript
option
Is this waiting on something before being merged? I'd like to use it as well. |
I'll go ahead and merge/release this. |
My team and I have run into multiple scenarios where we've wanted to output the update message when running as an npm script. To do this, we've had to dig through the source code, hack environment variables, run this package, and reset environment variables.
This PR include functionality to bypass the isNpm() check. This will not break any existing functionality.
Fixes #122