Never again miss the moment when your long-lasting script in the background completes, thanks to sound notifications! While the script is running, you can safely switch to an other task π§βπ» or take a break βοΈ, being sure you wonβt forget to check scriptβs results at the right time.
Speech-synthesized message
$ npm build && say βBuild succeeded!β || say βBuild failed!β
On MacOS you can use the command βsayβ for the speech synthesis via the CLI. With the help of operators &&
and ||
you can set a different message for a build success and failure.
Note: there seem to exist equivalent commands to βsayβ on other operating systems: ptts
on Windows and espeak
on Linux (which may differ a bit in syntax), however I didnβt try them.
Feel less frustrated
In the past I used to either stare a few minutes at the terminal waiting for the script to complete (which drained my energy and focus capabilities) or switch to an other task, eventually forgetting about the running script in the background. It was the most frustrating, was when I figured out the build failed. And it failed very early, just after I switched to an other task.
Be more productive
Sound notifications really helped me to be more productive while fixing bugs which required from me re-building an app many times a day. Especially when it was a long-lasting production build of a big Angular SSR application.
PS. For fun, you can customize the messages π, e.g.:
$ npm build && say βThis is Sparta!β || say βBuild failed. Get back, you lazybones!β
If you really feel like buying me a coffee
... then feel free to do it. Many thanks! π
Top comments (4)
We used this in the past for a long script setting up the dev environment.
At the end it said something like "Thanks for setting everything up, don't forget to install Firefox and come on AS Rome!".
The Firefox and AS Rome (the football club) was an inside joke between the devs.
Fun fact: after a few days we've been told by the marketing department that someone used that script during a demo and all the clients heard that and did weird faces.
Pro tip: use it with caution! π
π€£
Thanks for sharing this! I had no idea. Bet it will be helpful running npm install in our big mono-repos π
I'm more than happy if it helps you! π₯³