Skip to content
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

with emoji icons #55

Merged
merged 1 commit into from Jun 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses hasEmoji before it's assigned, so it'll always be false.


} 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