File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,8 @@ def collect_java_binaries(cmdline):
169
169
java_binaries .classpath_jar_files +
170
170
java_libraries .classpath_jar_files +
171
171
library_directories )
172
+
173
+ previously_created_folders = set ()
172
174
for ep_data in ep_config ["entryPoints" ]:
173
175
174
176
method_data = ep_data ["method" ]
@@ -183,11 +185,15 @@ def collect_java_binaries(cmdline):
183
185
184
186
# If our folder exists then just add (#number) to it and try creation again.
185
187
incrementor = 1
186
- while os . path . exists ( output_folder ) :
188
+ while output_folder in previously_created_folders :
187
189
folder_name = friendly_method_name .replace (os .path .sep , '.' ) + " (" + str (incrementor ) + ")"
188
190
output_folder = os .path .join (cmdline .results_dir , folder_name )
189
191
incrementor += 1
190
192
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
+
191
197
os .mkdir (output_folder )
192
198
193
199
generated_temp_folder = os .path .join (cmdline .temp_dir , folder_name )
You can’t perform that action at this time.
0 commit comments