Fork me on GitHub
#emacs
<
2018-08-15
>
vemv02:08:01

this is figwheel_server.log:

vemv02:08:26

I wonder if there's a way to "tail" it within emacs, invisibly, and whenever it matches Successfully compiled build, arbitary elisp code gets run (e.g. (message "Reloaded!"))

vemv05:08:29

I solved the underlying problem (but not the question itself) with a terminal command instead:

figwheel_notifications(){
  tail -n 1 -F figwheel_server.log | grep --line-buffered "Successfully\|Failed to compile\|Compiler Warning" | while IFS='' read line; do
    if grep --silent Succ <<< $line; then
      terminal-notifier -title 'Figwheel' -message "Successfully recompiled."
    elif grep --silent Warn <<< $line; then
      terminal-notifier -title 'Figwheel' -message "Compilation warning."
    else
      terminal-notifier -title 'Figwheel' -message "Compilation error."
    fi
  done
}
Uses https://github.com/julienXX/terminal-notifier