dylang / grunt-notify

Automatic Notifications when Grunt tasks fail.
https://npmjs.org/package/grunt-notify
MIT License
921 stars 73 forks source link

Can't figure out how to show success notification #84

Closed JakeSummers closed 10 years ago

JakeSummers commented 10 years ago

Good Afternoon,

Great plugin!

I have setup grunt-notify to trigger whenever less has run using a watch. This works great when the less task fails. Gives me a great pop-up error:

image

For reference this is the console output:

image

When less succeeds, I am not getting any notification. I would like to get a notification but cannot figure out how to enable this.

This is the console output when less succeeds:

image

This is the GruntFile that I am using:

module.exports = function(grunt) {

    grunt.initConfig({

        less: {
            development: {
                options: {
                    compress: true
                },
                files: {
                    "FILE.css": "FILE2.less"
                }
            }
        },

        watch: {
            less: {
                files: '**/*.less',
                tasks: ['less', 'notify_hooks']
            }
        },

        notify_hooks: {
            options: {
                message: "MESSAGE"
            }

        }

    });

    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-notify');

    grunt.registerTask("default", ['less']);

};
JakeSummers commented 10 years ago

Cross posted to StackOverflow: http://stackoverflow.com/questions/26042124/grunt-notify-doesnt-trigger-on-success

JakeSummers commented 10 years ago

Copy/Paste of DavidT's answer on StackOverflow:

You need to add a message for your task to the gruntfile and specify which task it is going to give that message for. See below

notify: {
    less:{
        options:{
            title: "CSS Files built"
            message: "Less task complete"
        }
    }
}

Link