From 9c6ba0b67ebf9fb8809fd85e438bc418a7ddb09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Andrei?= Date: Mon, 13 May 2024 11:23:24 -0300 Subject: [PATCH] Set default tag value to main. (Fixes #15) (#16) --- cookieplone/cli.py | 2 +- cookieplone/generator.py | 2 ++ news/15.bugfix | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 news/15.bugfix diff --git a/cookieplone/cli.py b/cookieplone/cli.py index a5ba0d6..ff85616 100644 --- a/cookieplone/cli.py +++ b/cookieplone/cli.py @@ -53,7 +53,7 @@ def cli( data.OptionalPath, typer.Option("--output-dir", "-o", help="Where to generate the code."), ] = None, - tag: Annotated[str, typer.Option(help="Tag.")] = "", + tag: Annotated[str, typer.Option(help="Tag.")] = "main", version: Annotated[ bool, typer.Option("--version", help="Display the version of cookieplone.") ] = False, diff --git a/cookieplone/generator.py b/cookieplone/generator.py index 8e7fa00..bc2a642 100644 --- a/cookieplone/generator.py +++ b/cookieplone/generator.py @@ -87,6 +87,8 @@ def generate( Context: {context_str} """ raise GeneratorException(message=msg, original=undefined_err) # noQA:B904 + except Exception as e: + raise GeneratorException(message=str(e), original=e) # noQA:B904 else: return Path(result) diff --git a/news/15.bugfix b/news/15.bugfix new file mode 100644 index 0000000..6d1946c --- /dev/null +++ b/news/15.bugfix @@ -0,0 +1 @@ +Set default `tag` value to **main** instead of the empty string [@ericof]