Skip to content

Commit

Permalink
Fix install command for npm global (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore authored and SBoudrias committed Jul 14, 2019
1 parent 592b025 commit bf73119
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ class UpdateNotifier {

if (options.isYarnGlobal) {
installCommand = `yarn global add ${this.packageName}`;
} else if (options.isGlobal) {
installCommand = `npm i -g ${this.packageName}`;
} else if (hasYarn()()) {
installCommand = `yarn add ${this.packageName}`;
} else {
installCommand = `npm i ${options.isGlobal ? '-g ' : ''}${this.packageName}`;
installCommand = `npm i ${this.packageName}`;
}

options.message = options.message || 'Update available ' + chalk().dim(this.update.current) + chalk().reset(' → ') +
Expand Down

0 comments on commit bf73119

Please sign in to comment.