Skip to content

Instantly share code, notes, and snippets.

@drodriguez
Created June 29, 2010 08:09
Show Gist options
  • Save drodriguez/456959 to your computer and use it in GitHub Desktop.
Save drodriguez/456959 to your computer and use it in GitHub Desktop.
#! /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