Created
June 29, 2010 08:09
-
-
Save drodriguez/456959 to your computer and use it in GitHub Desktop.
This file contains 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
#! /bin/bash | |
EXPIRATION_IN_SECONDS=5000 | |
ERROR_ICON=gtk-dialog-error | |
SUCCESS_ICON=gtk-dialog-info | |
function notify () | |
{ | |
notify-send -t $((EXPIRATION_IN_SECONDS*1000)) -i $3 "${1}" "${2}" | |
} | |
output=$(bundle exec spec --format specdoc --color $@ | tee /dev/tty) | |
result=${PIPESTATUS[0]} | |
output=$(echo "${output}" | tail -1) | |
if [ $result -ne 0 ]; then | |
notify 'FAIL' "${output}" $ERROR_ICON | |
else | |
notify 'Success' "${output}" $SUCCESS_ICON | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment