From 5db82f11aeec10203691aa31069ca563a955191f Mon Sep 17 00:00:00 2001 From: Evangelos Lamprou Date: Wed, 19 Nov 2025 14:34:21 -0500 Subject: [PATCH] avoid adding newline when previous command comes with one Signed-off-by: Evangelos Lamprou --- libbash/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbash/api.py b/libbash/api.py index 6461233..62a3f77 100644 --- a/libbash/api.py +++ b/libbash/api.py @@ -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