We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9dffb9b commit 5db82f1Copy full SHA for 5db82f1
1 file changed
libbash/api.py
@@ -62,7 +62,7 @@ def ast_to_bash(ast: list[Command], write_to: str):
62
for comm in ast:
63
command_string = bash.make_command_string(comm._to_ctypes())
64
bash_str += command_string
65
- bash_str += "\n".encode("utf-8")
+ bash_str += "\n".encode("utf-8") if not bash_str.endswith(b"\n") else b""
66
67
with open(write_to, "wb") as f:
68
# don't decode the bytes, just write them to the file
0 commit comments