Skip to content

Instantly share code, notes, and snippets.

@naganowl
Created February 13, 2014 03:37
Show Gist options
  • Save naganowl/8969332 to your computer and use it in GitHub Desktop.
Save naganowl/8969332 to your computer and use it in GitHub Desktop.
How to hook into Grunt events.
['warn', 'fatal'].forEach (level) ->
grunt.util.hooker.hook grunt.fail, level, (opt) ->
require('growl')(opt.name,
title: opt.message
image: 'Console'
)
['warn', 'error'].forEach (level) ->
grunt.util.hooker.hook grunt.log, level, (opt) ->
require('growl')(opt.name,
title: opt.message
image: 'Console'
)
grunt.event.on 'coffeelint:warn', (err, msg) ->
require('growl')(msg,
title: msg
image: 'Console'
)
grunt.event.on 'coffeelint:any', (status, message) ->
grunt.config ['notify', 'coffeelint'], options:
title: "Coffeelint #{status}"
message: message
grunt.task.run 'notify:coffeelint'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment