aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2010-08-07 22:15:29 -0700
committerAdam Vandenberg2010-08-07 22:15:29 -0700
commite2f0e1a26f31f494ec6b972d0e525b3cf9a6d3c9 (patch)
tree1b22091ed329a4172a3169876d3ceb428eadd9d8
parent612af6b4fe763346614316f8d7e3b5b1bc69cfda (diff)
downloadbrew-e2f0e1a26f31f494ec6b972d0e525b3cf9a6d3c9.tar.bz2
Resolve aliases in 'brew edit'.
-rw-r--r--Library/Homebrew/extend/ARGV.rb12
-rwxr-xr-xbin/brew5
2 files changed, 9 insertions, 8 deletions
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb
index d39df7d7f..61268fda3 100644
--- a/Library/Homebrew/extend/ARGV.rb
+++ b/Library/Homebrew/extend/ARGV.rb
@@ -102,12 +102,6 @@ module HomebrewArgvExtension
EOS
end
- private
-
- def downcased_unique_named
- @downcased_unique_named ||= named.map(&:downcase).uniq
- end
-
def resolve_alias name
aka = HOMEBREW_REPOSITORY+"Library/Aliases/#{name}"
if aka.file?
@@ -116,4 +110,10 @@ module HomebrewArgvExtension
name
end
end
+
+ private
+
+ def downcased_unique_named
+ @downcased_unique_named ||= named.map(&:downcase).uniq
+ end
end
diff --git a/bin/brew b/bin/brew
index 93854270d..135332d32 100755
--- a/bin/brew
+++ b/bin/brew
@@ -152,9 +152,10 @@ begin
"#{HOMEBREW_REPOSITORY}/bin/brew"<<
"#{HOMEBREW_REPOSITORY}/README.md"
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|
- 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'
raise FormulaUnavailableError, name
else