File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed
Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -52,17 +52,27 @@ def reset(ctx: click.Context) -> None:
5252 username = get_username (verbose )
5353 exercise_fork_name = f"{ username } -gitmastery-{ gitmastery_exercise_config .exercise_repo .repo_title } "
5454 delete_repo (exercise_fork_name , verbose )
55- rmtree (
55+
56+ if os .path .isdir (
5657 gitmastery_exercise_path / gitmastery_exercise_config .exercise_repo .repo_name
57- )
58- setup_exercise_folder (download_time , gitmastery_exercise_config , verbose )
59- info (
60- click .style (
61- f"cd { gitmastery_exercise_config .exercise_repo .repo_name } " ,
62- bold = True ,
63- italic = True ,
58+ ):
59+ # Only delete if the sub-folder present
60+ # Sub-folder may not be present if repo_type is "ignore" or if "ignore" but the
61+ # student has already created the sub-folder needed
62+ rmtree (
63+ gitmastery_exercise_path
64+ / gitmastery_exercise_config .exercise_repo .repo_name
65+ )
66+
67+ if gitmastery_exercise_config .exercise_repo .repo_type != "ignore" :
68+ setup_exercise_folder (download_time , gitmastery_exercise_config , verbose )
69+ info (
70+ click .style (
71+ f"cd { gitmastery_exercise_config .exercise_repo .repo_name } " ,
72+ bold = True ,
73+ italic = True ,
74+ )
6475 )
65- )
6676
6777 if not os .path .isdir (gitmastery_path / LOCAL_FOLDER_NAME ):
6878 warn (
You can’t perform that action at this time.
0 commit comments