diff options
| author | Yuval Adam <_@yuv.al> | 2024-05-17 12:26:14 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2024-05-18 13:12:23 +0200 |
| commit | 1a34d1bbde800d540c4e3f1e3dbe22678903ad86 (patch) | |
| tree | 7a6ca72c2e313a2f4a3527239014bb59a9159608 /cli/build.py | |
| parent | d9901fe020a419b40349ee9565fe1daa1bd225bd (diff) | |
Migrate all scripts to poetry
Diffstat (limited to 'cli/build.py')
| -rw-r--r-- | cli/build.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/build.py b/cli/build.py index 526e086..38874fe 100644 --- a/cli/build.py +++ b/cli/build.py @@ -1,3 +1,5 @@ +import click + from jinja2 import Environment, PackageLoader, select_autoescape from os import listdir, mkdir from pathlib import Path @@ -16,7 +18,8 @@ TEMPLATES = ["index.html"] @cli.command() -def build(): +@click.option("--verbose", "-v", is_flag=True) +def build(verbose): # copy static files if not BUILD_DIR.exists(): mkdir(BUILD_DIR) @@ -39,6 +42,12 @@ def build(): names = list(sorted(names, key=lambda x: x.domain)) candidates = list(sorted(candidates, key=lambda x: x.domain)) + if verbose: + names_str = [x.domain for x in names] + candidates_str = [x.domain for x in candidates] + print(f"Got {names_str=}") + print(f"Got {candidates_str=}") + def render_link(value, classes): name = unidecode(value.name).lower().split(" ") domain = unidecode(value.domain).replace(".", "") |
