From 410b1c78af1b98547eee6bdd5685fe60a668df8d Mon Sep 17 00:00:00 2001 From: JPaja Date: Sat, 3 May 2025 11:56:21 +0200 Subject: [PATCH 1/2] Add: checksum ignore --- ctfcli/core/challenge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctfcli/core/challenge.py b/ctfcli/core/challenge.py index 517f550..5e25132 100644 --- a/ctfcli/core/challenge.py +++ b/ctfcli/core/challenge.py @@ -736,7 +736,7 @@ def sync(self, ignore: Tuple[str] = ()) -> None: ) as lf: local_file_sha1sum = hash_file(lf) - if local_file_sha1sum == remote_file_sha1sum: + if not "checksum" in ignore and local_file_sha1sum == remote_file_sha1sum: continue # if sha1sums are not present, or the hashes are different, re-upload the file From 991adfc2b3e24d6a70e6361dfaae714c719628ad Mon Sep 17 00:00:00 2001 From: JPaja Date: Sun, 21 Dec 2025 18:22:58 +0100 Subject: [PATCH 2/2] Fix lint --- ctfcli/core/challenge.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ctfcli/core/challenge.py b/ctfcli/core/challenge.py index 5e25132..a20c8a5 100644 --- a/ctfcli/core/challenge.py +++ b/ctfcli/core/challenge.py @@ -736,8 +736,10 @@ def sync(self, ignore: Tuple[str] = ()) -> None: ) as lf: local_file_sha1sum = hash_file(lf) - if not "checksum" in ignore and local_file_sha1sum == remote_file_sha1sum: - continue + # Allow users to specify sha1sum in ignore to force reuploads + if "sha1sum" not in ignore: + if local_file_sha1sum == remote_file_sha1sum: + continue # if sha1sums are not present, or the hashes are different, re-upload the file self._delete_file(remote_files[local_file_name]["location"])