Skip to content

Instantly share code, notes, and snippets.

@hardyoyo
Created February 13, 2015 20:59
Show Gist options
  • Save hardyoyo/37fcbe726661aa15eb5e to your computer and use it in GitHub Desktop.
Save hardyoyo/37fcbe726661aa15eb5e to your computer and use it in GitHub Desktop.
.bash_aliases file to enable notifications for build success
# bash aliases for Vagrant-DSpace
alias maven="command mvn"
notified_maven() {
maven $* | \
perl -pe'$m|=/BUILD .*SUCCESS/; END {exit!$m}' && \
notify-send -u critical -i /usr/share/icons/Humanity/emblems/32/emblem-cool.png "`basename $(pwd)`: mvn $*" "Build SUCCESS" || \
notify-send -u critical -i /usr/share/icons/Humanity/emblems/32/emblem-ohno.png "`basename $(pwd)`: mvn $*" "Build FAILED"
}
notified_ant() {
ant $* | \
perl -pe'$m|=/BUILD .*SUCCESSFUL/; END {exit!$m}' && \
notify-send -u critical -i /usr/share/icons/Humanity/emblems/32/emblem-cool.png "`basename $(pwd)`: ant $*" "Build SUCCESSFUL" || \
notify-send -u critical -i /usr/share/icons/Humanity/emblems/32/emblem-ohno.png "`basename $(pwd)`: ant $*" "Build FAILED"
}
alias mvn=notified_maven
alias ant=notified_ant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment