Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libbash/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def ast_to_bash(ast: list[Command], write_to: str):
for comm in ast:
command_string = bash.make_command_string(comm._to_ctypes())
bash_str += command_string
bash_str += "\n".encode("utf-8")
bash_str += "\n".encode("utf-8") if not bash_str.endswith(b"\n") else b""

with open(write_to, "wb") as f:
# don't decode the bytes, just write them to the file
Expand Down
Loading