@@ -52,6 +52,12 @@ def copy_solution_files(exercise: ExerciseInfo, workdir: Path, exercise_config:
5252 exemplar_files = []
5353 helper_files = []
5454
55+ if helper_files :
56+ helper_files = [exercise .path / h for h in helper_files ]
57+ for helper_file in helper_files :
58+ dst = workdir / helper_file .relative_to (exercise .path )
59+ copy_file (helper_file , dst )
60+
5561 if not solution_files :
5662 solution_files .append (exercise .solution_stub .name )
5763 solution_files = [exercise .path / s for s in solution_files ]
@@ -68,12 +74,6 @@ def copy_solution_files(exercise: ExerciseInfo, workdir: Path, exercise_config:
6874 dst = workdir / solution_file .relative_to (exercise .path )
6975 copy_file (exemplar_file , dst )
7076
71- if helper_files :
72- helper_files = [exercise .path / h for h in helper_files ]
73- for helper_file in helper_files :
74- dist = workdir / helper_file .relative_to (exercise .path )
75- copy_file (helper_file , dist )
76-
7777
7878def copy_test_files (exercise : ExerciseInfo , workdir : Path , exercise_config = None ):
7979 if exercise_config is not None :
@@ -82,6 +82,13 @@ def copy_test_files(exercise: ExerciseInfo, workdir: Path, exercise_config = Non
8282 else :
8383 test_files = []
8484 helper_files = []
85+
86+ if helper_files :
87+ for helper_file_name in helper_files :
88+ helper_file = exercise .path / helper_file_name
89+ helper_file_out = workdir / helper_file_name
90+ copy_file (helper_file , helper_file_out , strip_skips = (exercise .slug not in ALLOW_SKIP ))
91+
8592 if not test_files :
8693 test_files .append (exercise .test_file .name )
8794
@@ -90,11 +97,6 @@ def copy_test_files(exercise: ExerciseInfo, workdir: Path, exercise_config = Non
9097 test_file_out = workdir / test_file_name
9198 copy_file (test_file , test_file_out , strip_skips = (exercise .slug not in ALLOW_SKIP ))
9299
93- if helper_files is not None :
94- for helper_file_name in helper_files :
95- helper_file = exercise .path / helper_file_name
96- dst = workdir / helper_file .relative_to (exercise .path )
97- copy_file (helper_file , dst )
98100
99101def copy_exercise_files (exercise : ExerciseInfo , workdir : Path ):
100102 exercise_config = None
0 commit comments