Skip to content

Commit ff5c8a9

Browse files
author
Miłosz Skaza
authored
better file comparing (#142)
* use sha1sum to compare files when syncing and verifying * `load_installed_challenge` should throw an exception when it fails to load the challenge. This has been always assumed and there are checks before that call, but there's just no reason for it to return None instead of throwing.
1 parent 588443f commit ff5c8a9

File tree

4 files changed

+206
-124
lines changed

4 files changed

+206
-124
lines changed

ctfcli/cli/challenges.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
from ctfcli.core.challenge import Challenge
1515
from ctfcli.core.config import Config
1616
from ctfcli.core.deployment import get_deployment_handler
17-
from ctfcli.core.exceptions import ChallengeException, LintException
17+
from ctfcli.core.exceptions import (
18+
ChallengeException,
19+
LintException,
20+
RemoteChallengeNotFound,
21+
)
1822
from ctfcli.utils.git import get_git_repo_head_branch
1923

2024
log = logging.getLogger("ctfcli.cli.challenges")
@@ -774,8 +778,9 @@ def healthcheck(self, challenge: Optional[str] = None) -> int:
774778
)
775779
return 1
776780

777-
challenge_data = Challenge.load_installed_challenge(challenge_id)
778-
if not challenge_data:
781+
try:
782+
challenge_data = Challenge.load_installed_challenge(challenge_id)
783+
except RemoteChallengeNotFound:
779784
click.secho(f"Could not load data for challenge '{challenge_instance}'.", fg="red")
780785
return 1
781786

0 commit comments

Comments
 (0)