Skip to content

Commit aaabee4

Browse files
authored
Merge pull request diffblue#571 from diffblue/jd/feature/duplicate_clash_enhancement
Clean up existing entry-point folder existence logic
2 parents c696d88 + a3c1c08 commit aaabee4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

driver/mkbench.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ def collect_java_binaries(cmdline):
169169
java_binaries.classpath_jar_files +
170170
java_libraries.classpath_jar_files +
171171
library_directories)
172+
173+
previously_created_folders = set()
172174
for ep_data in ep_config["entryPoints"]:
173175

174176
method_data = ep_data["method"]
@@ -183,11 +185,15 @@ def collect_java_binaries(cmdline):
183185

184186
# If our folder exists then just add (#number) to it and try creation again.
185187
incrementor = 1
186-
while os.path.exists(output_folder):
188+
while output_folder in previously_created_folders:
187189
folder_name = friendly_method_name.replace(os.path.sep, '.') + " (" + str(incrementor) + ")"
188190
output_folder = os.path.join(cmdline.results_dir, folder_name)
189191
incrementor += 1
190192

193+
previously_created_folders.add(output_folder)
194+
if os.path.exists(output_folder) and os.path.isdir(output_folder):
195+
shutil.rmtree(output_folder)
196+
191197
os.mkdir(output_folder)
192198

193199
generated_temp_folder = os.path.join(cmdline.temp_dir, folder_name)

0 commit comments

Comments
 (0)