Skip to content

Commit 335d7b7

Browse files
committed
Also print included templates
1 parent 0721012 commit 335d7b7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ctfcli/cli/templates.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import shutil
33
import subprocess
44
from glob import glob
5+
from pathlib import Path
56

7+
from ctfcli.utils.config import get_base_path
68
from ctfcli.utils.templates import get_template_dir
79

810

@@ -18,6 +20,12 @@ def uninstall(self, template_name):
1820
shutil.rmtree(template_dir)
1921

2022
def list(self):
23+
# Print included templates
24+
path = Path(get_base_path()) / "templates"
25+
for dir in path.iterdir():
26+
print(dir.relative_to(path))
27+
28+
# Print installed templates
2129
template_dir = get_template_dir() + "/"
2230
for template in glob(f"{template_dir}/**/*/cookiecutter.json", recursive=True):
2331
# Remove prefix of template_dir and remove suffix of /cookiecutter.json

0 commit comments

Comments
 (0)