Created
February 10, 2012 00:53
-
-
Save mmalecki/1784896 to your computer and use it in GitHub Desktop.
Nice script for getting Travis build status image URL (in Markdown!)
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
| #!/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 "[](http://travis-ci.org/#{slug})" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment