Skip to content

Instantly share code, notes, and snippets.

@mmalecki
Created February 10, 2012 00:53
Show Gist options
  • Select an option

  • Save mmalecki/1784896 to your computer and use it in GitHub Desktop.

Select an option

Save mmalecki/1784896 to your computer and use it in GitHub Desktop.
Nice script for getting Travis build status image URL (in Markdown!)
#!/usr/bin/env ruby
if ARGV[0] and ARGV[1]
slug = ARGV[0] + "/" + ARGV[1]
else
url = `git config --get remote.origin.url`
return $?.exitstatus if $?.exitstatus != 0
m = /git@github\.com:([a-zA-Z0-9_-]+)\/([a-zA-Z0-9._-]+)\.git/.match(url)
slug = m[1] + "/" + m[2]
end
$stdout.write "[![Build Status](https://secure.travis-ci.org/#{slug}.png)](http://travis-ci.org/#{slug})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment