Skip to content

Instantly share code, notes, and snippets.

@alexspurling
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexspurling/15e093a13764c6f7d747 to your computer and use it in GitHub Desktop.
Save alexspurling/15e093a13764c6f7d747 to your computer and use it in GitHub Desktop.
OSX terminal notification for completed builds
#Add an alias for your build commands for example:
alias make='notify make'
alias mvn='notify mvn'
#Make sure the notify is defined in your shell
source ~/dev/scripts/notify.sh
#Install terminal-notifier from: https://github.com/alloy/terminal-notifier
#Define a function to notify
function notify {
$@;
exitcode=$?
if [ $exitcode -eq 0 ]
then
terminal-notifier -sound 'Glass' -title 'Success!' -message "$* ran successfully";
else
terminal-notifier -sound 'Basso' -title 'Failure!' -message "$* ran unsuccessfully";
fi
return $exitcode;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment