Sha256: 75849ea820cce4a439259d28826a2b40f74a27c8e5e4d5a5bdc7508160ab9d20

Contents?: true

Size: 964 Bytes

Versions: 1

Compression:

Stored size: 964 Bytes

Contents

#!/usr/bin/env ruby

# create a github review request for the current branch
# usage:
# git reviewrequest

require File.join(File.dirname(__FILE__), '..', 'lib', 'socialcast-git-extensions.rb')
include Socialcast::Git
include Socialcast::Github

branch = current_branch
username = `git config -z --global --get github.user`.strip
password = HighLine.ask("Github password: ") { |q| q.echo = false }
description = HighLine.ask("Pull Request description (blank line to complete)") { |q| q.gather = /^\W*$/}

run_cmd 'git update'

repo = `git config -z --get remote.origin.url`.strip
# ex: git@github.com:socialcast/socialcast-git-extensions.git
repo = repo.scan(/:(.+\/.+)\./).first.first
url = create_pull_request username, password, branch, repo, description.join("\n")

if url
  share "@SocialcastDevelopers #reviewrequest for #{branch} #scgitx", {:url => url, :message_type => 'review_request'}
else
  HighLine.say "Skipping socialcast announcement"
  exit 1
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
socialcast-git-extensions-2.3.3 bin/git-reviewrequest