Resolve aliases in 'brew edit'.
This commit is contained in:
parent
612af6b4fe
commit
e2f0e1a26f
@ -102,12 +102,6 @@ module HomebrewArgvExtension
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def downcased_unique_named
|
|
||||||
@downcased_unique_named ||= named.map(&:downcase).uniq
|
|
||||||
end
|
|
||||||
|
|
||||||
def resolve_alias name
|
def resolve_alias name
|
||||||
aka = HOMEBREW_REPOSITORY+"Library/Aliases/#{name}"
|
aka = HOMEBREW_REPOSITORY+"Library/Aliases/#{name}"
|
||||||
if aka.file?
|
if aka.file?
|
||||||
@ -116,4 +110,10 @@ module HomebrewArgvExtension
|
|||||||
name
|
name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def downcased_unique_named
|
||||||
|
@downcased_unique_named ||= named.map(&:downcase).uniq
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
5
bin/brew
5
bin/brew
@ -152,9 +152,10 @@ begin
|
|||||||
"#{HOMEBREW_REPOSITORY}/bin/brew"<<
|
"#{HOMEBREW_REPOSITORY}/bin/brew"<<
|
||||||
"#{HOMEBREW_REPOSITORY}/README.md"
|
"#{HOMEBREW_REPOSITORY}/README.md"
|
||||||
else
|
else
|
||||||
# we don't use ARGV.formulae as that will throw if the file doesn't parse
|
# Don't use ARGV.formulae as that will throw if the file doesn't parse
|
||||||
paths = ARGV.named.collect do |name|
|
paths = ARGV.named.collect do |name|
|
||||||
unless File.exist? path = "#{HOMEBREW_REPOSITORY}/Library/Formula/#{name}.rb"
|
path = "#{HOMEBREW_REPOSITORY}/Library/Formula/#{ARGV.resolve_alias(name)}.rb"
|
||||||
|
unless File.exist? path
|
||||||
require 'formula'
|
require 'formula'
|
||||||
raise FormulaUnavailableError, name
|
raise FormulaUnavailableError, name
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user