Merge pull request #8889 from hyuraku/fix_brew_edit

fix brew edit
This commit is contained in:
Mike McQuaid 2020-10-20 13:36:31 +01:00 committed by GitHub
commit 4b361c26ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,12 @@ module Homebrew
EOS
end
paths = args.named.to_formulae_paths.presence
paths = args.named.to_formulae_paths.select do |path|
next path if path.exist?
raise UsageError, "#{path} doesn't exist on disk. " \
"Run #{Formatter.identifier("brew create $URL")} to create a new Formula!"
end.presence
# If no brews are listed, open the project root in an editor.
paths ||= [HOMEBREW_REPOSITORY]