fix brew edit

This commit is contained in:
hyuraku 2020-10-20 20:48:43 +09:00
parent ccb271bee4
commit ae81ed1353

View File

@ -28,7 +28,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]