Skip to content

Commit 2807194

Browse files
committed
Relative path in generate_file
1 parent 49a05ab commit 2807194

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/python/generator/generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def generate_file(self, filename: str, file_content: str, dml_file: str):
8989
with open(target_file, "w") as new_script:
9090
new_script.write(self.licence)
9191
new_script.write(self.generated_by)
92-
new_script.write((self.generated_from + dml_file.replace("\\", "/") + "\n").replace(
93-
"../", "").replace("src/main/python/generator/", ""))
92+
relative_path = os.path.relpath(dml_file, start=self.source_path)
93+
new_script.write(f"{self.generated_from}scripts/builtin/{relative_path}\n")
9494
new_script.write(self.imports)
9595
new_script.write(file_content)
9696

0 commit comments

Comments
 (0)