watchr icon indicating copy to clipboard operation
watchr copied to clipboard

feature: Hooks

Open mattwynne opened this issue 15 years ago • 1 comments

I was thinking about how to hack in some autotest style feedback for my watchr script. What I'd really like are two hooks I think:

  • before
  • after

I can use the before hook to show a spinner, then the after hook to show red/green status. The after hook could be passed the string result of the handler block maybe? That would be enough to work out a pass / fail in your hook.

WDYT? I appreciate you're trying to keep this thing simple, but it would open up some more possibilities. If you like the idea I can try and hack it together in a fork.

mattwynne avatar Jun 03 '10 12:06 mattwynne

It should be simple enough to emulate by wrapping actions in a #run method. But I can see how generic hooks could be used by external code, like a plugin, in a much cleaner way. A growl-type plugin would be interesting, I admit. If you're still willing to write the patch, I'd certainly apply it. Thanks for the suggestion.

mynyml avatar Jul 05 '10 19:07 mynyml