From 5c7c7a4ce66ed5d0174b338d05b4dc96eb0d7f55 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 19 Feb 2015 10:58:51 +0000 Subject: [PATCH] pull: support taps, use same version as test-bot. --- Library/Homebrew/cmd/pull.rb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb index 5ab329f73f..2b8da3475d 100644 --- a/Library/Homebrew/cmd/pull.rb +++ b/Library/Homebrew/cmd/pull.rb @@ -159,19 +159,16 @@ module Homebrew # Publish bottles on Bintray bintray_user = ENV["BINTRAY_USER"] bintray_key = ENV["BINTRAY_KEY"] - bintray_repo = if tap_name - tap_name.sub("/", "-") + "-bottles" - else - "bottles" - end - # Skip taps for now until we're using Bintray for Homebrew/homebrew - if bintray_user && bintray_key && !tap_name + if bintray_user && bintray_key + bintray_repo = Bintray.repository(tap_name) changed_formulae.each do |f| + next unless `git show --oneline --no-patch` =~ /: add .+ bottle./ ohai "Publishing on Bintray:" - safe_system "curl", "--silent", "--fail", + version = Bintray.version(f.bottle.url) + curl "--silent", "--fail", "-u#{bintray_user}:#{bintray_key}", "-X", "POST", - "https://api.bintray.com/content/homebrew/#{bintray_repo}/#{f.name}/#{f.version}/publish" + "https://api.bintray.com/content/homebrew/#{bintray_repo}/#{f.name}/#{version}/publish" puts end end