Skip to content

Commit 71f7cb7

Browse files
mew1033ColdHeat
andauthored
Can't compare relative paths to absolute paths (#193)
* Can't compare relative paths to absolute paths * Use full challenge_file_path * Fix lint --------- Co-authored-by: Kevin Chung <kchung@ctfd.io>
1 parent d98ab55 commit 71f7cb7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

ctfcli/cli/challenges.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ def sync(self, challenge: str = None, ignore: Union[str, Tuple[str]] = ()) -> in
653653
if isinstance(ignore, str):
654654
ignore = (ignore,)
655655

656-
config = Config()
656+
_config = Config()
657657
remote_challenges = Challenge.load_installed_challenges()
658658

659659
failed_syncs = []
@@ -672,9 +672,7 @@ def sync(self, challenge: str = None, ignore: Union[str, Tuple[str]] = ()) -> in
672672
continue
673673

674674
click.secho(
675-
f"Syncing '{challenge_name}' ("
676-
f"{challenge_instance.challenge_file_path.relative_to(config.project_path)}"
677-
f") ...",
675+
f"Syncing '{challenge_name}' (" f"{challenge_instance.challenge_file_path}" ") ...",
678676
fg="blue",
679677
)
680678
try:
@@ -720,7 +718,7 @@ def deploy(
720718
else:
721719
skipped_deployments.append(challenge_instance)
722720

723-
config = Config()
721+
_config = Config()
724722
with click.progressbar(deployable_challenges, label="Deploying challenges") as challenges:
725723
for challenge_instance in challenges:
726724
click.echo()
@@ -748,7 +746,7 @@ def deploy(
748746

749747
click.secho(
750748
f"Deploying challenge service '{challenge_name}' "
751-
f"({challenge_instance.challenge_file_path.relative_to(config.project_path)}) "
749+
f"({challenge_instance.challenge_file_path}) "
752750
f"with {deployment_handler.__class__.__name__} ...",
753751
fg="blue",
754752
)
@@ -816,7 +814,7 @@ def deploy(
816814
click.secho("Success!\n", fg="green")
817815

818816
if len(skipped_deployments) > 0:
819-
click.secho("Deployment skipped (no image specified) for:",fg="yellow")
817+
click.secho("Deployment skipped (no image specified) for:", fg="yellow")
820818
for challenge_instance in skipped_deployments:
821819
click.echo(f" - {challenge_instance}")
822820

0 commit comments

Comments
 (0)