Skip to content

Instantly share code, notes, and snippets.

@whaley
Created September 25, 2011 14:33
Show Gist options
  • Save whaley/1240647 to your computer and use it in GitHub Desktop.
Save whaley/1240647 to your computer and use it in GitHub Desktop.
Passing mvn output through awk.
#! /bin/bash
mvn $* | awk '
{
print;
if($0 ~ ".*ERROR.*") system("/usr/local/bin/growlnotify -n mavenError -t Maven Error -m\""$0 "\"")
if($0 ~ ".*BUILD SUCCESSFUL.*") system("/usr/local/bin/growlnotify -n mavenComplete -t Maven Goals Complete -m\""$0 "\"")
}
END {
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment