From 3f489e1eed73584b7a7b7ca175f945102a9f4f0e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 31 Oct 2013 18:21:03 -0700 Subject: [PATCH] bottle: write to relative path if exists. --- Library/Homebrew/cmd/bottle.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 04f2fb3efd..3927d84daa 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -194,7 +194,12 @@ module Homebrew extend self if ARGV.include? '--write' f = Formula.factory formula_name - formula_path = HOMEBREW_REPOSITORY+"Library/Formula/#{f.name}.rb" + formula_relative_path = "Library/Formula/#{f.name}.rb" + if File.exists? formula_relative_path + formula_path = Pathname.new(formula_relative_path) + else + formula_path = HOMEBREW_REPOSITORY+formula_relative_path + end inreplace formula_path do |s| if f.bottle s.gsub!(/ bottle do.+?end\n/m, output)