Skip to content

Commit 502bd84

Browse files
committed
Support ignore repo types
1 parent 9143230 commit 502bd84

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

app/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ def cli(ctx, verbose) -> None:
3030
latest_version = Version.parse_version_string(tags[0]["name"])
3131
if current_version.is_behind(latest_version):
3232
warn(
33-
f"Your version of Git-Mastery app {click.style(current_version, bold=True)} is behind the latest version {click.style(latest_version, bold=True, italic=True)}."
33+
f"Your version of Git-Mastery app {click.style(current_version, bold=True)} is {click.style('behind the latest version', fg='bright_red')} {click.style(latest_version, bold=True, italic=True)}."
3434
)
35+
warn("We strongly recommend upgrading your app.")
3536
warn(
3637
f"Follow the update guide here: {click.style('https://git-mastery.github.io/app/update', bold=True)}"
3738
)

app/commands/download.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,17 @@ def download(ctx: click.Context, exercise: str) -> None:
183183
is_binary,
184184
)
185185

186-
setup_exercise_folder(download_time, config, verbose)
187-
info(
188-
click.style(
189-
f"cd {exercise}/{config.exercise_repo.repo_name}", bold=True, italic=True
186+
if config.exercise_repo.repo_type != "ignore":
187+
setup_exercise_folder(download_time, config, verbose)
188+
info(
189+
click.style(
190+
f"cd {exercise}/{config.exercise_repo.repo_name}",
191+
bold=True,
192+
italic=True,
193+
)
190194
)
191-
)
195+
else:
196+
config.downloaded_at = download_time.timestamp()
197+
info(click.style(f"cd {exercise}", bold=True, italic=True))
198+
with open(".gitmastery-exercise.json", "w") as gitmastery_exercise_file:
199+
gitmastery_exercise_file.write(config.to_json())

app/exercise_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class ExerciseConfig:
88
@dataclass
99
class ExerciseRepoConfig:
10-
repo_type: Literal["local", "remote"]
10+
repo_type: Literal["local", "remote", "ignore"]
1111
repo_name: str
1212
repo_title: Optional[str]
1313
create_fork: Optional[bool]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ pyinstaller
44
requests
55
types-requests
66
pytermgui
7-
git-autograder==5.*
7+
git-autograder==6.*
88
pytz
99
PyYAML

0 commit comments

Comments
 (0)