diff options
| author | Mike McQuaid | 2013-10-31 18:21:03 -0700 |
|---|---|---|
| committer | Mike McQuaid | 2013-10-31 18:21:03 -0700 |
| commit | 3f489e1eed73584b7a7b7ca175f945102a9f4f0e (patch) | |
| tree | fe5393fede59cb7b675ad8704b955367184562cc | |
| parent | b0bf181788f4c0b0b5a9835133c3126e5011ec6c (diff) | |
| download | brew-3f489e1eed73584b7a7b7ca175f945102a9f4f0e.tar.bz2 | |
bottle: write to relative path if exists.
| -rw-r--r-- | Library/Homebrew/cmd/bottle.rb | 7 |
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) |
