Last active
August 29, 2015 14:15
-
-
Save alexspurling/15e093a13764c6f7d747 to your computer and use it in GitHub Desktop.
OSX terminal notification for completed builds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Add an alias for your build commands for example: | |
alias make='notify make' | |
alias mvn='notify mvn' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Make sure the notify is defined in your shell | |
source ~/dev/scripts/notify.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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