@@ -214,14 +214,22 @@ pub fn prepare_submission(
214214 let config = plugin. get_exercise_packaging_configuration ( config) ?;
215215 for path in config. student_file_paths {
216216 let student_file = project_root. join ( & path) ;
217- if student_file. exists ( ) {
217+ if student_file. is_file ( ) {
218218 file_util:: copy ( student_file, & dest) ?;
219+ } else if student_file. is_dir ( ) {
220+ let mut dest = dest. join ( path) ;
221+ dest. pop ( ) ; // the dest will include the target dir, pop to avoid copying a/b/c to a/b/c/c
222+ file_util:: copy ( & student_file, dest) ?;
219223 }
220224 }
221225 for path in config. exercise_file_paths {
222226 let exercise_file = tests_dir. join ( & path) ;
223- if exercise_file. exists ( ) {
224- // todo --no-target-directory?
227+ // todo --no-target-directory?
228+ if exercise_file. is_file ( ) {
229+ file_util:: copy ( exercise_file, & dest) ?;
230+ } else if exercise_file. is_dir ( ) {
231+ let mut dest = dest. join ( path) ;
232+ dest. pop ( ) ; // the dest will include the target dir, pop to avoid copying a/b/c to a/b/c/c
225233 file_util:: copy ( exercise_file, & dest) ?;
226234 }
227235 }
0 commit comments