This commit is contained in:
parent
4cef77e4e0
commit
3dc623f1c7
3 changed files with 18 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "zona"
|
name = "zona"
|
||||||
version = "1.2.0"
|
version = "1.2.1"
|
||||||
description = "Opinionated static site generator."
|
description = "Opinionated static site generator."
|
||||||
license = "BSD-3-Clause "
|
license = "BSD-3-Clause "
|
||||||
license-files = ["LICENSE"]
|
license-files = ["LICENSE"]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
from importlib.metadata import version as __version__
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Annotated
|
from typing import Annotated
|
||||||
|
|
||||||
|
@ -134,8 +135,23 @@ def serve(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def version_callback(value: bool):
|
||||||
|
if value:
|
||||||
|
print(f"Zona version: {__version__('zona')}")
|
||||||
|
raise typer.Exit()
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
def main_entry(
|
def main_entry(
|
||||||
|
version: Annotated[ # pyright: ignore[reportUnusedParameter]
|
||||||
|
bool | None,
|
||||||
|
typer.Option(
|
||||||
|
"--version",
|
||||||
|
callback=version_callback,
|
||||||
|
is_eager=True,
|
||||||
|
help="Print version info and exit.",
|
||||||
|
),
|
||||||
|
] = None,
|
||||||
verbosity: Annotated[
|
verbosity: Annotated[
|
||||||
str,
|
str,
|
||||||
typer.Option(
|
typer.Option(
|
||||||
|
|
2
uv.lock
generated
2
uv.lock
generated
|
@ -459,7 +459,7 @@ wheels = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zona"
|
name = "zona"
|
||||||
version = "1.2.0"
|
version = "1.2.1"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "dacite" },
|
{ name = "dacite" },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue