From f8ec9cc338c44364cfe049e159f101ff46054f6a Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Thu, 7 May 2026 08:56:32 -0700 Subject: [PATCH] fix update_brewfile --- bin/macos/update_brewfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/macos/update_brewfile b/bin/macos/update_brewfile index a099df5..7c950a7 100755 --- a/bin/macos/update_brewfile +++ b/bin/macos/update_brewfile @@ -251,7 +251,13 @@ def main(args): if last_type and e.pkg_type != last_type: output_lines.append("") last_type = e.pkg_type - output_lines.extend(e.to_lines()) + + lines = e.to_lines() + # If we just added a blank line, and the new lines start with one, skip the first new line + if output_lines and output_lines[-1] == "" and lines and lines[0] == "": + output_lines.extend(lines[1:]) + else: + output_lines.extend(lines) new_content = "\n".join(output_lines) if footer: