Skip to content

Instantly share code, notes, and snippets.

@nick-markowski
Last active February 9, 2017 12:33
Show Gist options
  • Select an option

  • Save nick-markowski/7cfe2aee15062f10fc2151324db75281 to your computer and use it in GitHub Desktop.

Select an option

Save nick-markowski/7cfe2aee15062f10fc2151324db75281 to your computer and use it in GitHub Desktop.
PR_helper
#!/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