Skip to content

Commit e3a14c1

Browse files
authored
Fix ctf challenge add by having it commit changes to .ctf/config (#74)
1 parent d26b45c commit e3a14c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ctfcli/cli/challenges.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ def add(self, repo):
8484
with open(get_config_path(), "w+") as f:
8585
config.write(f)
8686

87+
subprocess.call(
88+
["git", "add", ".ctf/config"], cwd=get_project_path(),
89+
)
90+
subprocess.call(
91+
["git", "commit", "-m", f"Added {str(challenge_path)}"],
92+
cwd=get_project_path(),
93+
)
94+
8795
elif Path(repo).exists():
8896
config["challenges"][repo] = repo
8997
with open(get_config_path(), "w+") as f:

0 commit comments

Comments
 (0)