fix update_brewfile

This commit is contained in:
David Tomaschik
2026-05-07 08:56:32 -07:00
parent 6e3c3dd269
commit f8ec9cc338

View File

@@ -251,7 +251,13 @@ def main(args):
if last_type and e.pkg_type != last_type: if last_type and e.pkg_type != last_type:
output_lines.append("") output_lines.append("")
last_type = e.pkg_type 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) new_content = "\n".join(output_lines)
if footer: if footer: