Skip to content

Commit

Permalink
brew edit works if the file in question won't parse
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Nov 7, 2009
1 parent 0495cf5 commit 8e676a3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/brew
Expand Up @@ -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'
Expand Down

0 comments on commit 8e676a3

Please sign in to comment.