But, you could do something like this (it hurts me to write this)
hugo server 2>&1 | tee /dev/tty | while read line ; do echo $line | say --rate=500 ; done
This uses the say command to read the output of hugo server, while still showing hugo server output in your console. The --rate=500 is words per minute.
It won’t beep at you, but it’ll read the actual error message to you.
So, how do you guys set things up so that you are immediately aware of an issue (outside of having the terminal on top)?
Usually if I make a breaking change, then http://localhost:1313/ will display nothing. From that point I’m like, “let’s check the console to see what I broke.”
Assuming macOS you could also pipe tty thru grep to check for the string ERROR since that’s consistent for errors in Hugo, then do a say to alert you. You can just say whatever; you don’t need to have it read the error.
If *nix, just use the beep command in some pattern.
Thanks. I had been doing it that way in Gulp before I switched to Hugo and started using its server. I guess I got so used to it, I missed it once I stopped using Gulp.