Skip to content

Commit 4d9c0e0

Browse files
authored
Update create_tester.py
1 parent 5089cac commit 4d9c0e0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spine_tester/create_tester.py

+10
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,23 @@ def find_spinescene_files():
5353

5454
# Dictionary to store component URLs and their animations
5555
component_animations = {}
56+
# Dictionary to track file name counts
57+
file_name_count = {}
5658

5759
# Write the generated embedded_component text to the go.go file
5860
with open(go_output_file_path, "w") as go_file:
5961
print("\nGenerate Components:")
6062
if spinescene_files:
6163
for spinescene_file in spinescene_files:
6264
file_name = os.path.basename(spinescene_file).replace(".spinescene", "")
65+
66+
# If the file name already exists, append an index to the file name
67+
if file_name in file_name_count:
68+
file_name_count[file_name] += 1
69+
file_name = f"{file_name}_{file_name_count[file_name]}"
70+
else:
71+
file_name_count[file_name] = 0
72+
6373
component_url = f"/go#{file_name}"
6474

6575
# Read the spinescene file to find the spine_json path

0 commit comments

Comments
 (0)