Skip to content

Instantly share code, notes, and snippets.

@jonschlinkert
Forked from FGRibreau/grunt_growl.js
Created October 22, 2012 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonschlinkert/3929300 to your computer and use it in GitHub Desktop.
Save jonschlinkert/3929300 to your computer and use it in GitHub Desktop.
How to get Growl notifications from Grunt.js
/* Inside grunt.js file (don't forget to add "growl" as a project dependency) */
grunt.utils.hooker.hook(grunt.fail, "warn", function(opt) {
require('growl')(opt.name, {
title: opt.message,
image: 'Console'
});
});
/* ... or, since fail.fatal() will stop grunt it seems a good idea to track it too */
var growl = require('growl');
['warn', 'fatal'].forEach(function(level) {
grunt.utils.hooker.hook(grunt.fail, level, function(opt) {
growl(opt.name, {
title: opt.message,
image: 'Console'
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment