fix: add newline to JSON exports

Add empty line in the end of auto generate/update doctype files, in order to follow the python code style
This commit is contained in:
Hicham Dachir 2025-03-10 07:44:25 +01:00 committed by GitHub
parent 1c3ec9bf81
commit 381ee5682c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,7 +54,7 @@ def write_document_file(doc, record_module=None, create_init=True, folder_name=N
if is_custom_module and not Path(path).resolve().is_relative_to(Path(frappe.get_site_path()).resolve()):
frappe.throw("Invalid export path: " + Path(path).as_posix())
with open(path, "w+") as txtfile:
txtfile.write(frappe.as_json(doc_export))
txtfile.write(frappe.as_json(doc_export) + "\n")
print(f"Wrote document file for {doc.doctype} {doc.name} at {path}")