From 43eb4a0fdfc175e5e49f719c09a6d3ad79f93267 Mon Sep 17 00:00:00 2001 From: missytake Date: Mon, 9 Oct 2023 07:49:06 +0200 Subject: [PATCH] specify environment variable --- src/teams_bot/cli.py | 4 ++-- src/teams_bot/pyinfra.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/teams_bot/cli.py b/src/teams_bot/cli.py index 3e47981..f3528d6 100644 --- a/src/teams_bot/cli.py +++ b/src/teams_bot/cli.py @@ -39,7 +39,7 @@ def teams_bot(ctx): "--password", type=str, default=None, help="the password of the email account" ) @click.option( - "--db_dir", type=str, default="teams_bot_data", help="path to the bot's database" + "--dbdir", type=str, default="teams_bot_data", help="path to the bot's database", envvar="TEAMS_DBDIR" ) @click.option( "-v", "--verbose", count=True, help="show low level delta chat ffi events" @@ -121,7 +121,7 @@ def init(ctx, email: str, password: str, db_dir: str, verbose: int): @teams_bot.command() @click.option( - "--db_dir", type=str, default="teams_bot_data", help="path to the bot's database" + "--dbdir", type=str, default="teams_bot_data", help="path to the bot's database", envvar="TEAMS_DBDIR" ) @click.option( "-v", "--verbose", count=True, help="show low level delta chat ffi events" diff --git a/src/teams_bot/pyinfra.py b/src/teams_bot/pyinfra.py index 69eda69..8c6fc09 100644 --- a/src/teams_bot/pyinfra.py +++ b/src/teams_bot/pyinfra.py @@ -43,8 +43,7 @@ def deploy_teams_bot(unix_user: str, bot_email: str, bot_passwd: str, dbdir: str secrets = [ f"TEAMS_INIT_EMAIL={bot_email}", f"TEAMS_INIT_PASSWORD={bot_passwd}", - f'TEAMS_INIT_DBDIR={dbdir}', - f'TEAMS_RUN_DBDIR={dbdir}', + f'TEAMS_DBDIR={dbdir}', ] env = "\n".join(secrets) files.put(