diff options
| author | Markus Reiter | 2016-09-23 22:02:23 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-09-24 12:24:35 +0200 |
| commit | 58e36c73193befb57d351344cea2a4a33fef850d (patch) | |
| tree | 3d26751835440341e5a42a189cf580e6253785df /Library/Homebrew/dev-cmd/test-bot.rb | |
| parent | bbc3f1c3a852e6cfd26a7a7c333092fae0520eb4 (diff) | |
| download | brew-58e36c73193befb57d351344cea2a4a33fef850d.tar.bz2 | |
Fix Style/GuardClause.
Diffstat (limited to 'Library/Homebrew/dev-cmd/test-bot.rb')
| -rw-r--r-- | Library/Homebrew/dev-cmd/test-bot.rb | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb index abf0235e5..935a40731 100644 --- a/Library/Homebrew/dev-cmd/test-bot.rb +++ b/Library/Homebrew/dev-cmd/test-bot.rb @@ -123,13 +123,12 @@ module Homebrew end end - if git_url = ENV["UPSTREAM_GIT_URL"] || ENV["GIT_URL"] - # Also can get tap from Jenkins GIT_URL. - url_path = git_url.sub(%r{^https?://github\.com/}, "").chomp("/").sub(/\.git$/, "") - begin - return Tap.fetch(url_path) if url_path =~ HOMEBREW_TAP_REGEX - rescue - end + return unless git_url = ENV["UPSTREAM_GIT_URL"] || ENV["GIT_URL"] + # Also can get tap from Jenkins GIT_URL. + url_path = git_url.sub(%r{^https?://github\.com/}, "").chomp("/").sub(/\.git$/, "") + begin + return Tap.fetch(url_path) if url_path =~ HOMEBREW_TAP_REGEX + rescue end end @@ -1001,10 +1000,9 @@ module Homebrew end end - if git_tag - safe_system "git", "tag", "--force", git_tag - safe_system "git", "push", "--force", remote, "master:master", "refs/tags/#{git_tag}" - end + return unless git_tag + safe_system "git", "tag", "--force", git_tag + safe_system "git", "push", "--force", remote, "master:master", "refs/tags/#{git_tag}" end def sanitize_argv_and_env @@ -1053,13 +1051,12 @@ module Homebrew ARGV << "--fast" if ARGV.include?("--ci-master") - if ARGV.include? "--local" - ENV["HOMEBREW_CACHE"] = "#{ENV["HOME"]}/Library/Caches/Homebrew" - mkdir_p ENV["HOMEBREW_CACHE"] - ENV["HOMEBREW_HOME"] = ENV["HOME"] = "#{Dir.pwd}/home" - mkdir_p ENV["HOME"] - ENV["HOMEBREW_LOGS"] = "#{Dir.pwd}/logs" - end + return unless ARGV.include?("--local") + ENV["HOMEBREW_CACHE"] = "#{ENV["HOME"]}/Library/Caches/Homebrew" + mkdir_p ENV["HOMEBREW_CACHE"] + ENV["HOMEBREW_HOME"] = ENV["HOME"] = "#{Dir.pwd}/home" + mkdir_p ENV["HOME"] + ENV["HOMEBREW_LOGS"] = "#{Dir.pwd}/logs" end def test_bot |
