Skip to content

Commit

Permalink
Merge pull request #55 from a-x-/patch-1
Browse files Browse the repository at this point in the history
with `emoji` icons
  • Loading branch information
Turbo87 committed Jun 26, 2019
2 parents fd5213d + 138b849 commit 1563c71
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Expand Up @@ -45,7 +45,7 @@ WebpackNotifierPlugin.prototype.compileMessage = function(stats) {

} else if (!this.lastBuildSucceeded || this.options.alwaysNotify) {
this.lastBuildSucceeded = true;
return 'Build successful';
return (hasEmoji ? '✅ ' : '') + 'Build successful';

} else {
return;
Expand All @@ -57,12 +57,13 @@ WebpackNotifierPlugin.prototype.compileMessage = function(stats) {
if (error.module && error.module.rawRequest)
message = error.module.rawRequest + '\n';

var hasEmoji = this.options.emoji;
if (error.error)
message = 'Error: ' + message + error.error.toString();
message = (hasEmoji ? '❌ ' : '') + 'Error: ' + message + error.error.toString();
else if (error.warning)
message = 'Warning: ' + message + error.warning.toString();
message = (hasEmoji ? '⚠️ ' : '') + 'Warning: ' + message + error.warning.toString();
else if (error.message) {
message = 'Warning: ' + message + error.message.toString();
message = (hasEmoji ? '⚠️ ' : '') + 'Warning: ' + message + error.message.toString();
}

return stripANSI(message);
Expand Down

0 comments on commit 1563c71

Please sign in to comment.