aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMax Howell2009-11-05 23:11:42 +0000
committerMax Howell2009-11-07 18:22:36 +0000
commitfba0a5c5cd7755bb80f8fa8fe37291890dc9ca35 (patch)
tree5419f3c56454faac3033d3df453d81afd1dbda41 /bin
parent57fc32d27927503d8eb379e2907c42933f8732f1 (diff)
downloadbrew-fba0a5c5cd7755bb80f8fa8fe37291890dc9ca35.tar.bz2
brew edit works if the file in question won't parse
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew13
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/brew b/bin/brew
index e59a3d2f8..cebc147de 100755
--- a/bin/brew
+++ b/bin/brew
@@ -124,9 +124,18 @@ begin
exec 'mate', *Dir["#{HOMEBREW_REPOSITORY}/Library/*"]<<
"#{HOMEBREW_REPOSITORY}/bin/brew"<<
"#{HOMEBREW_REPOSITORY}/README.md"
- else
- exec_editor *ARGV.formulae.collect {|f| f.path}
+ else
+ # we 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"
+ require 'formula'
+ raise FormulaUnavailableError, name
+ else
+ path
+ end
end
+ exec_editor *paths
+ end
when 'up', 'update'
require 'update'