Created
February 27, 2013 21:55
-
-
Save ajsharp/5052138 to your computer and use it in GitHub Desktop.
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 | |
| # Usage: ./script/pull-request | |
| # | |
| # Run this script after you've pushed your local branch to origin and you're | |
| # ready to create a PR. | |
| # install hub if not in user's $PATH | |
| if `which hub`.chomp == '' | |
| puts "`hub` not found, installing..." | |
| system("gem install hub") | |
| end | |
| current_branch = `git branch | grep '\*' | awk '{print $2}'`.chomp | |
| url = `hub pull-request -h zaarly:#{current_branch}` | |
| # open the url in the browser | |
| system "open #{url}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment