Use Formula.path
This commit is contained in:
parent
2d50501c4e
commit
26785dbe5d
@ -30,7 +30,7 @@ module Homebrew extend self
|
|||||||
if name.include? '/'
|
if name.include? '/'
|
||||||
Pathname.new(name)
|
Pathname.new(name)
|
||||||
else
|
else
|
||||||
HOMEBREW_REPOSITORY+"Library/Formula/#{name}.rb"
|
Formula.path(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
unless ARGV.force?
|
unless ARGV.force?
|
||||||
|
|||||||
@ -25,7 +25,7 @@ module Homebrew extend self
|
|||||||
|
|
||||||
ARGV.named.each do |name|
|
ARGV.named.each do |name|
|
||||||
# if a formula has been tapped ignore the blacklisting
|
# if a formula has been tapped ignore the blacklisting
|
||||||
if not File.file? HOMEBREW_REPOSITORY/"Library/Formula/#{name}.rb"
|
unless Formula.path(name).file?
|
||||||
msg = blacklisted? name
|
msg = blacklisted? name
|
||||||
raise "No available formula for #{name}\n#{msg}" if msg
|
raise "No available formula for #{name}\n#{msg}" if msg
|
||||||
end
|
end
|
||||||
|
|||||||
@ -8,7 +8,7 @@ module Homebrew extend self
|
|||||||
path = ARGV.formulae.first.path.realpath
|
path = ARGV.formulae.first.path.realpath
|
||||||
rescue FormulaUnavailableError
|
rescue FormulaUnavailableError
|
||||||
# Maybe the formula was deleted
|
# Maybe the formula was deleted
|
||||||
path = HOMEBREW_REPOSITORY/"Library/Formula/#{ARGV.named.first}.rb"
|
path = Formula.path(ARGV.named.first)
|
||||||
end
|
end
|
||||||
cd path.dirname # supports taps
|
cd path.dirname # supports taps
|
||||||
exec "git", "log", *ARGV.options_only + ["--", path]
|
exec "git", "log", *ARGV.options_only + ["--", path]
|
||||||
|
|||||||
@ -403,7 +403,7 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
# test if the name is a core formula
|
# test if the name is a core formula
|
||||||
formula_with_that_name = Pathname.new("#{HOMEBREW_LIBRARY}/Formula/#{name}.rb")
|
formula_with_that_name = Formula.path(name)
|
||||||
if formula_with_that_name.file? and formula_with_that_name.readable?
|
if formula_with_that_name.file? and formula_with_that_name.readable?
|
||||||
return name
|
return name
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user