Merge pull request #13888 from Bo98/formulary-absolute-alias
formulary: fix error with absolute alias paths
This commit is contained in:
commit
d56d8a9c42
@ -670,7 +670,8 @@ module Formulary
|
|||||||
return TapLoader.new(ref, from: from)
|
return TapLoader.new(ref, from: from)
|
||||||
end
|
end
|
||||||
|
|
||||||
return FromPathLoader.new(ref) if File.extname(ref) == ".rb" && Pathname.new(ref).expand_path.exist?
|
pathname_ref = Pathname.new(ref)
|
||||||
|
return FromPathLoader.new(ref) if File.extname(ref) == ".rb" && pathname_ref.expand_path.exist?
|
||||||
|
|
||||||
if Homebrew::EnvConfig.install_from_api?
|
if Homebrew::EnvConfig.install_from_api?
|
||||||
return FormulaAPILoader.new(ref) if Homebrew::API::Formula.all_formulae.key?(ref)
|
return FormulaAPILoader.new(ref) if Homebrew::API::Formula.all_formulae.key?(ref)
|
||||||
@ -680,8 +681,12 @@ module Formulary
|
|||||||
formula_with_that_name = core_path(ref)
|
formula_with_that_name = core_path(ref)
|
||||||
return FormulaLoader.new(ref, formula_with_that_name) if formula_with_that_name.file?
|
return FormulaLoader.new(ref, formula_with_that_name) if formula_with_that_name.file?
|
||||||
|
|
||||||
possible_alias = core_alias_path(ref)
|
possible_alias = if pathname_ref.absolute?
|
||||||
return AliasLoader.new(possible_alias) if possible_alias.file?
|
pathname_ref
|
||||||
|
else
|
||||||
|
core_alias_path(ref)
|
||||||
|
end
|
||||||
|
return AliasLoader.new(possible_alias) if possible_alias.symlink?
|
||||||
|
|
||||||
possible_tap_formulae = tap_paths(ref)
|
possible_tap_formulae = tap_paths(ref)
|
||||||
raise TapFormulaAmbiguityError.new(ref, possible_tap_formulae) if possible_tap_formulae.size > 1
|
raise TapFormulaAmbiguityError.new(ref, possible_tap_formulae) if possible_tap_formulae.size > 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user