feat: add build command

This commit is contained in:
Corentin 2024-05-20 15:46:58 +02:00
parent 1f1037dd01
commit 1a32cb2b42
1 changed files with 14 additions and 4 deletions

View File

@ -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)})