Last active
February 9, 2017 12:33
-
-
Save nick-markowski/7cfe2aee15062f10fc2151324db75281 to your computer and use it in GitHub Desktop.
PR_helper
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/ruby | |
| require 'highline/import' | |
| # 1 | |
| repo = ARGV[0] | |
| dir = ARGV[1] | |
| reponame = repo.split('/')[1] | |
| system( "git clone https://github.com/#{repo} #{dir}" ) or raise "Failed to git clone #{reponame}" | |
| if dir | |
| Dir.chdir dir | |
| else | |
| Dir.chdir reponame | |
| end | |
| #2 | |
| system( "git-pulls update" ) or raise "Failed to pull git | |
| updates for #{reponame}" | |
| #3 | |
| pr_id = ask "What PR ID would you like to check out locally?" | |
| system ( "hub checkout https://github.com/#{repo}/pull/#{pr_id}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment