File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -53,13 +53,23 @@ def find_spinescene_files():
53
53
54
54
# Dictionary to store component URLs and their animations
55
55
component_animations = {}
56
+ # Dictionary to track file name counts
57
+ file_name_count = {}
56
58
57
59
# Write the generated embedded_component text to the go.go file
58
60
with open (go_output_file_path , "w" ) as go_file :
59
61
print ("\n Generate Components:" )
60
62
if spinescene_files :
61
63
for spinescene_file in spinescene_files :
62
64
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
+
63
73
component_url = f"/go#{ file_name } "
64
74
65
75
# Read the spinescene file to find the spine_json path
You can’t perform that action at this time.
0 commit comments