Giter Site home page Giter Site logo

Comments (12)

cowboy avatar cowboy commented on August 26, 2024

Does this lib fail gracefully if the user doesn't have growl installed on all supported OSes?

from grunt.

rwaldron avatar rwaldron commented on August 26, 2024

No idea, but I'll look into it and we can chat on Monday or whatever

from grunt.

Jontyy avatar Jontyy commented on August 26, 2024

Is there anyway we can add a custom hook for when any tasks fail?

from grunt.

cowboy avatar cowboy commented on August 26, 2024

@Jontyy how would you use that? Can you give me an example?

from grunt.

Jontyy avatar Jontyy commented on August 26, 2024

@cowboy Maybe something like

var exec = require('child_process').exec;

config.init({/*...*/});
//whatever the failure listener is
grunt.on('task.fail',function(task){
   var cmd = 'notify-send "Grunt - Task failed" '+task; //I'm on ubuntu
   exec(cmd);
});

I'm at work so not got much time to comment but something along them lines, obviously the api could be more consistent with what grunt provides already but I imagine it will be trivial for me to make my own failure listener which would work on OS X (at work) and Ubuntu (at home)

Edit:

maybe it would be better on the task object.

task.fail(function(task){/*...*/});

from grunt.

cowboy avatar cowboy commented on August 26, 2024

@Jontyy I've created a more general issue for this at #70.

from grunt.

johnkpaul avatar johnkpaul commented on August 26, 2024

I don't know where this stands anymore, but I started working on this today here. My immediate need is just to be able to see the grunt watch output in growl, so I don't have to switch terminals in order to read them.

Currently, if you add the --growl option to grunt, all log messages are pushed to grunt using the node-growl dependency. I believe that it fails silently if growl is not available on the current platform. All it does is delegate to require('child_process').exec which doesn't do anything on failed shell commands.

from grunt.

ggoforth avatar ggoforth commented on August 26, 2024

This would be awesome. Is a pull request in the near future?

from grunt.

johnkpaul avatar johnkpaul commented on August 26, 2024

@ggoforth I have actually finished it, and it works for me, but I don't know if it would be as useful for others. Currently, it takes all output that would go to stdout, and pushes that to growl. Once issue #70 is completed, then this exact issue would be trivial in my code, but I haven't yet attempted to only publish the error notifications to growl.

from grunt.

vladikoff avatar vladikoff commented on August 26, 2024

You guys should checkout Grunt Growl: https://github.com/alextucker/grunt-growl
Haven't tried it with task failures yet.

from grunt.

FGRibreau avatar FGRibreau commented on August 26, 2024

Here is a quick work around. It uses grunt.utils.hooker and node-growl.

from grunt.

cowboy avatar cowboy commented on August 26, 2024

Once events have been added per #328, you'll be able to implement this entirely on your end using events... so feel free to participate in that discussion!

from grunt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.