diff --git a/jwebsite/cli.py b/jwebsite/cli.py index 2df8fb7..98aa597 100644 --- a/jwebsite/cli.py +++ b/jwebsite/cli.py @@ -1,6 +1,16 @@ -from click import command +from pathlib import Path + +from click import group + +from jwebsite.site import Site -@command -def main() -> None: - print("Hello world") +@group +def main() -> None: ... + + +@main.command +def build() -> None: + cwd = Path.cwd() + with open(cwd / "site.py", encoding="utf-8") as site_config: + exec(site_config.read(), {"site": Site(cwd)})