Update file writing to use stored scm branch content

This commit is contained in:
Nicolas Saillant 2024-09-03 09:05:55 +02:00
parent b2e6a4abb0
commit e7ab525ead
1 changed files with 4 additions and 1 deletions

View File

@ -108,8 +108,11 @@ with open(input_report_file_name, "rt", encoding="utf-8") as input_report_file:
if not os.path.isdir(name): if not os.path.isdir(name):
is_ignored = True is_ignored = True
os.mkdir(name) os.mkdir(name)
with open("{}/../../../../../.scm-branch".format(os.getcwd()), 'r', encoding="utf-8") as scm_branch_file:
scm_branch_content = scm_branch_file.read()
with open("{dir}/{file}".format(dir=name, file=report_file_name), "w+", encoding="utf-8") as report_file_handle: with open("{dir}/{file}".format(dir=name, file=report_file_name), "w+", encoding="utf-8") as report_file_handle:
report_file_handle.write(open("{}/../../../../../.scm-branch".format(os.getcwd()), 'r', encoding="utf-8").read()) report_file_handle.write(scm_branch_content)
else: else:
is_ignored = False is_ignored = False
file_path = "{dir}/{file}".format(dir=name, file=report_file_name) file_path = "{dir}/{file}".format(dir=name, file=report_file_name)