From beb59d5db5eb9c7c331b46e6a8cdf39c2f3e6ea2 Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Tue, 20 Feb 2024 17:11:45 +0100 Subject: [PATCH] fix env var reading at startup --- src/hayhooks/cli/run/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hayhooks/cli/run/__init__.py b/src/hayhooks/cli/run/__init__.py index a66d954..135a37f 100644 --- a/src/hayhooks/cli/run/__init__.py +++ b/src/hayhooks/cli/run/__init__.py @@ -6,7 +6,9 @@ @click.command() @click.option('--host', default="localhost") @click.option('--port', default=1416) -@click.option('--pipelines-dir', default="pipelines.d") +@click.option('--pipelines-dir', default=os.environ.get("HAYHOOKS_PIPELINES_DIR")) def run(host, port, pipelines_dir): + if not pipelines_dir: + pipelines_dir = "pipelines.d" os.environ["HAYHOOKS_PIPELINES_DIR"] = pipelines_dir uvicorn.run("hayhooks.server:app", host=host, port=port)