Skip to content
Snippets Groups Projects
Commit 9cd4fff0 authored by Shaun Jackman's avatar Shaun Jackman
Browse files

pull: Add --test-bot-user

Infer the name of the test-bot GitHub user if it is not provided.
parent 76021db6
No related branches found
No related tags found
No related merge requests found
#: * `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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment