Merge pull request #19922 from Homebrew/brew_bundle_add_create

bundle/adder: create Brewfile if it doesn't exist.
This commit is contained in:
Mike McQuaid 2025-05-09 12:53:12 +00:00 committed by GitHub
commit 6f39076b3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,9 @@ module Homebrew
sig { params(args: String, type: Symbol, global: T::Boolean, file: String).void }
def add(*args, type:, global:, file:)
brewfile_path = Brewfile.path(global:, file:)
brewfile_path.write("") unless brewfile_path.exist?
brewfile = Brewfile.read(global:, file:)
content = brewfile.input
# TODO: - support `:describe`