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

Emit events #16

Merged
merged 1 commit into from
Jul 1, 2013
Merged

Emit events #16

merged 1 commit into from
Jul 1, 2013

Conversation

es128
Copy link
Contributor

@es128 es128 commented Jun 10, 2013

Example usage with grunt-notify (in Gruntfile.coffee):

grunt.event.on 'coffeelint:any', (status, message) ->
    grunt.config ['notify', 'coffeelint'], options:
        title: "Coffeelint #{status}"
        message: message
    grunt.task.run 'notify:coffeelint'

Resolves #14

Example usage with `grunt-notify` (in Gruntfile.coffee):

	grunt.event.on 'coffeelint:any', (status, message) ->
		grunt.config ['notify', 'coffeelint'], options:
			title: "Coffeelint #{status}"
			message: message
		grunt.task.run 'notify:coffeelint'



Resolves vojtajina#14
@vojtajina
Copy link
Owner

THanks @es128 !

vojtajina added a commit that referenced this pull request Jul 1, 2013
@vojtajina vojtajina merged commit c3faa02 into vojtajina:master Jul 1, 2013
@danielkcz
Copy link
Contributor

There is a slight problem with this. If there is more messages incoming, only last message is sent to growl. It's because grunt.task.run pushes to the queue and messages are overwritten.

Simplest way to solve it is using different task name all the time.

n = 0
grunt.event.on 'coffeelint:any', (status, message) ->
    grunt.config ['notify', "coffeelint#{n}"], options:
        title: "Coffeelint #{status}"
        message: message
    grunt.task.run "notify:coffeelint#{n}"
    n++

It's not pretty, but it works.

Gobie pushed a commit to Gobie/grunt-coffeelint that referenced this pull request Jan 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doesn't work with grunt-notify
3 participants