Skip to content

Instantly share code, notes, and snippets.

@danielhfrank
Created April 9, 2015 18:31
Show Gist options
  • Save danielhfrank/ab5f0dab1c75fcd3573a to your computer and use it in GitHub Desktop.
Save danielhfrank/ab5f0dab1c75fcd3573a to your computer and use it in GitHub Desktop.
ci-notify
#!/usr/bin/env ruby
PENDING=2
NO_STATUS=3
return_txt = ""
loop do
return_txt = `hub ci-status -v`
break unless [PENDING, NO_STATUS].include?($?.exitstatus)
sleep(1)
end
status_txt, url = return_txt.split(':', 2).map{|s| s.strip}
url_args = status_txt == 'success' ? '' : "-open #{url}"
exec("terminal-notifier -message 'Build #{status_txt}' -title 'ci-notify' #{url_args}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment