Skip to content

Commit ef4bea6

Browse files
committed
bundle/adder: create Brewfile if it doesn't exist.
This provides a nicer interface into using `brew bundle add` as a first command.
1 parent bfce68a commit ef4bea6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Library/Homebrew/bundle/adder.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ module Adder
1111

1212
sig { params(args: String, type: Symbol, global: T::Boolean, file: String).void }
1313
def add(*args, type:, global:, file:)
14+
brewfile_path = Brewfile.path(global:, file:)
15+
brewfile_path.write("") unless brewfile_path.exist?
16+
1417
brewfile = Brewfile.read(global:, file:)
1518
content = brewfile.input
1619
# TODO: - support `:describe`

0 commit comments

Comments
 (0)