aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2013-10-31 18:21:03 -0700
committerMike McQuaid2013-10-31 18:21:03 -0700
commit60e85e9f0140f90d7c016db832068c4ba5798828 (patch)
tree37979ec2d7507672e54242cdd7ea8735d9f21d8e
parent916efbe93f0e9fd43e462d9dacf2836d26294d1b (diff)
downloadhomebrew-60e85e9f0140f90d7c016db832068c4ba5798828.tar.bz2
bottle: write to relative path if exists.
-rw-r--r--Library/Homebrew/cmd/bottle.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb
index 04f2fb3ef..3927d84da 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)