Skip to content

Commit a263936

Browse files
committed
SCons: Use more native to scons approach for scu
Followup to godotengine#98888. Note here can't be any regressions like godotengine#99607 because here separator is not OS dependent and set explicitly Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
1 parent aa8d9b8 commit a263936

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

scu_builders.py

+4-22
Original file line numberDiff line numberDiff line change
@@ -130,28 +130,10 @@ def write_exception_output_file(file_count, exception_string, output_folder, out
130130

131131

132132
def find_section_name(sub_folder):
133-
# Construct a useful name for the section from the path for debug logging
134-
section_path = os.path.abspath(base_folder_path + sub_folder) + "/"
135-
136-
folders = []
137-
folder = ""
138-
139-
for i in range(8):
140-
folder = os.path.dirname(section_path)
141-
folder = os.path.basename(folder)
142-
if folder == base_folder_only:
143-
break
144-
folders.append(folder)
145-
section_path += "../"
146-
section_path = os.path.abspath(section_path) + "/"
147-
148-
section_name = ""
149-
for n in range(len(folders)):
150-
section_name += folders[len(folders) - n - 1]
151-
if n != (len(folders) - 1):
152-
section_name += "_"
153-
154-
return section_name
133+
from SCons.Script import Dir
134+
135+
rel_path = Dir(sub_folder).get_tpath()
136+
return "_".join(Path(rel_path).parts)
155137

156138

157139
# "folders" is a list of folders to add all the files from to add to the SCU

0 commit comments

Comments
 (0)