From ef4bea60a4c9428736366238f3143fced12cc034 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 9 May 2025 12:58:06 +0100 Subject: [PATCH] bundle/adder: create Brewfile if it doesn't exist. This provides a nicer interface into using `brew bundle add` as a first command. --- Library/Homebrew/bundle/adder.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/bundle/adder.rb b/Library/Homebrew/bundle/adder.rb index bcb698f98d..6c1599619f 100644 --- a/Library/Homebrew/bundle/adder.rb +++ b/Library/Homebrew/bundle/adder.rb @@ -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`