aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaun Jackman2017-10-06 16:17:00 -0700
committerShaun Jackman2017-10-17 16:53:12 -0700
commit9cd4fff051fa64d2c72ea55c97b819b3db9d1df9 (patch)
tree90e4cc8cd13092a76cd5343a49095b4ee8c20c95
parent76021db6029b2a1787ade83127c0431baa4b38fe (diff)
downloadbrew-9cd4fff051fa64d2c72ea55c97b819b3db9d1df9.tar.bz2
pull: Add --test-bot-user
Infer the name of the test-bot GitHub user if it is not provided.
-rw-r--r--Library/Homebrew/dev-cmd/pull.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb
index 130e9ed5d..0e3b37e3f 100644
--- a/Library/Homebrew/dev-cmd/pull.rb
+++ b/Library/Homebrew/dev-cmd/pull.rb
@@ -1,4 +1,4 @@
-#: * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] [`--bintray-org=`<bintray-org>] <patch-source> [<patch-source>]:
+#: * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] [`--bintray-org=`<bintray-org>] [`--test-bot-user=`<test-bot-user>] <patch-source> [<patch-source>]:
#:
#: Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
#: Optionally, installs the formulae changed by the patch.
@@ -44,6 +44,9 @@
#:
#: If `--bintray-org=`<bintray-org> is passed, publish at the given Bintray
#: organisation.
+#:
+#: If `--test-bot-user=`<test-bot-user> is passed, pull the bottle block
+#: commit from the specified user on GitHub.
require "net/http"
require "net/https"
@@ -228,7 +231,7 @@ module Homebrew
url
else
bottle_branch = "pull-bottle-#{issue}"
- "https://github.com/BrewTestBot/homebrew-#{tap.repo}/compare/homebrew:master...pr-#{issue}"
+ "https://github.com/#{test_bot_user user}/homebrew-#{tap.repo}/compare/#{user}:master...pr-#{issue}"
end
curl "--silent", "--fail", "--output", "/dev/null", "--head", bottle_commit_url
@@ -256,6 +259,13 @@ module Homebrew
verify_bintray_published(bintray_published_formulae)
end
+ def test_bot_user(user)
+ test_bot = ARGV.value "test-bot-user"
+ return test_bot if test_bot
+ return "BrewTestBot" if user.casecmp("homebrew").zero?
+ "#{user.capitalize}TestBot"
+ end
+
def force_utf8!(str)
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
end