This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I want to be able to send notifications when an incremental build completes, either with a success or a failure. In my case I want to play a sound with a shell script, but you could imagine also sending a macOS notification as well. Is the best place to do this in :build-hooks
? I took a look at the build-hooks documentation but it wasn’t clear to me whether build failures would get called in the hooks.
build hooks are not called for failures currently. there is another option if you do not mind a bit of clojure code. its undocumented so let me make you an example
this would be one way via the undocumented plugin system. basically the :start
fn is called when shadow-cljs starts, it depends on the system-bus
"service/component" shadow-cljs has and subscribes to the ::m/worker-broadcast
core.async topic, i.e. internal pub/sub system. https://github.com/thheller/shadow-cljs/blob/master/src/dev/demo/notify_plugin.clj
this only receives watch
updates though, it does not work for release/compile
builds
added the prn
as examples, you can run anything you want there. this is just clojure code after all.
I could change things so that build failures are still called for build hooks in some way, if this doesn't work for you
Nice, thanks! This is only needed for watch builds so that is perfect