hfour/wsrun

Feature: run a certain command if any step fails

Opened this issue · 1 comments

I am currently using wsrun and watch as follows:

yarn run watch --filter=watch-filter.js "yarn wsrun --stages --report --fast-exit ws:build"

Since I am not looking at it most of the time while it is running, it would be nice to be able to hook onto the completion of any "run" (once all stages succeed, or any fails). For example, if it fails I'd like to get a system notification of the failure, and if it succeeds I'd like to see how long it took or the last time it ran, etc. when I next go back to the terminal. I'm guessing this would be another option that specifies a command to be run on complete, which gets passed a success/failure, or one command to be run on success and one to be run on failure. Or it could be all the different hooks in the lifecycle (started, stopped, etc.).

I am glad to contribute a PR, but I would appreciate some high level guidance if you have any preference on how I do that. Please let me know if you need any further information from me.

Thanks for this project!

Also, I have a version working with && and ||

yarn run watch --filter=watch-filter.js "on-start.sh && yarn wsrun --stages --report --fast-exit ws:build && on-success.sh || on-failure.sh"

which achieves my basic goals, but it would be nicer if wsrun had the hooks