File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -334,20 +334,21 @@ def add_testcase(in_file: Path) -> None:
334
334
if (export_dir / "statement" ).exists ():
335
335
(export_dir / "statement" ).rename (export_dir / "problem_statement" )
336
336
for d in ["solution" , "problem_slide" ]:
337
- if (export_dir / d ).is_dir ():
338
- for f in list (util .glob (problem .path , f"{ d } /*" )):
339
- if f .is_file ():
340
- out = Path ("problem_statement" ) / f .relative_to (problem .path / d )
341
- if out .exists ():
342
- message (
343
- f"Can not export { f .relative_to (problem .path )} as { out } " ,
344
- "Zip" ,
345
- output ,
346
- color_type = MessageType .WARN ,
347
- )
348
- else :
349
- add_file (out , f )
350
- shutil .rmtree (export_dir / d )
337
+ if not (export_dir / d ).is_dir ():
338
+ continue
339
+ for f in list (util .glob (problem .path , f"{ d } /*" )):
340
+ if f .is_file ():
341
+ out = Path ("problem_statement" ) / f .relative_to (problem .path / d )
342
+ if out .exists ():
343
+ message (
344
+ f"Can not export { f .relative_to (problem .path )} as { out } " ,
345
+ "Zip" ,
346
+ output ,
347
+ color_type = MessageType .WARN ,
348
+ )
349
+ else :
350
+ add_file (out , f )
351
+ shutil .rmtree (export_dir / d )
351
352
352
353
# handle yaml updates
353
354
yaml_path .unlink ()
You can’t perform that action at this time.
0 commit comments