dylang / grunt-notify

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

No notification appears on Windows #91

Open stephane-r opened 9 years ago

stephane-r commented 9 years ago

Hi guys,

After installing grunt-notify on my project and Growl for Windows (7), i don't have notification if i start any task.

A part of my gruntfile :

    notify: {
        watch: {
            options: {
                title: 'Task Complete',  // optional
                message: 'SASS and Uglify finished running', //required
            }
        }
    }

// 4. Nous disons à Grunt quoi faire lorsque nous tapons "grunt" dans la console.
grunt.task.run('notify_hooks');

// Les tâches par défaut
grunt.registerTask('default', 'cmq', 'concat', 'uglify', 'watch', 'notify_hooks');
grunt.registerTask('dev', ['watch', 'notify']);

Any idea ? :)

Thank you !

stephane-r commented 9 years ago

Up :)

asokol1981 commented 9 years ago

Try adding:

windowsVerbatimArguments: true

to options array of:

grunt-notify\lib\util\spawn.js

Config's title and message must be double-quoted, like so:

title: '"Task Complete"',
message: '"SASS and Uglify finished running"'
alexberanger commented 9 years ago

Hello!

Windows 7 users, maybe this fix can help you !

Just change: '/i:' + image with windowsOnly('/i:"') + image.replace(/\\/g,"/") + windowsOnly('"') in grunt-notify/lib/platforms/growl-notify.js, line 72.

It correctly escape the system path to the notification icon file ;)

Very happy seeing again my notifications here :D !!!

stephane-r commented 9 years ago

Hi guys :)

I still have no notifications on Windows (7 and 10). Maybe my gruntfile can help you :

notify_hooks: {
    options: {
        enabled: true,
        max_js_hint_notifications: 5,
        title: 'Cookiejar'
    }
},

grunt.registerTask('test', ['php']);
grunt.registerTask('dev', ['watch', 'notify_hooks']);
grunt.registerTask('default', 'concat', 'watch');

// Les tâches de productions
grunt.registerTask('prod', ['concat', 'uglify', 'sass', 'combine_mq', 'cssmin']);

Edit : I've notif only if i've a error on my gruntfile (example task not found).

Thank you !

alexberanger commented 9 years ago

Hi!

Try putting your title and message between " and ', like in the following example: watch: { options: { title: '"Watch"', message: '"Snipers on the roof, sir!"' } },

It's a piece of my Gruntfile ;)

stephane-r commented 9 years ago

Hi Alex,

Thank you, working nice on Windows 10 ! :) (i'll test on W7 tomorrow :D)

rquadling commented 8 years ago

https://github.com/dylang/grunt-notify/pull/113