We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
--yaml-path
ctf challenge add
1 parent 192b1de commit c27282bCopy full SHA for c27282b
ctfcli/cli/challenges.py
@@ -53,7 +53,7 @@ def templates(self):
53
54
Templates().list()
55
56
- def add(self, repo):
+ def add(self, repo, yaml_path=None):
57
config = load_config()
58
59
if repo.endswith(".git"):
@@ -67,7 +67,13 @@ def add(self, repo):
67
challenge_path = challenge_path / base_repo_path
68
print(challenge_path)
69
70
- config["challenges"][str(challenge_path)] = repo
+ # If a custom yaml_path is specified we add it to our challenge_key
71
+ if yaml_path:
72
+ challenge_key = str(challenge_path / yaml_path)
73
+ else:
74
+ challenge_key = str(challenge_path)
75
+
76
+ config["challenges"][challenge_key] = repo
77
78
head_branch = get_git_repo_head_branch(repo)
79
subprocess.call(
0 commit comments