From 4399da4bf237d3bcb3e44a4cd4412640299ab179 Mon Sep 17 00:00:00 2001 From: missytake Date: Sun, 8 Oct 2023 11:50:43 +0200 Subject: [PATCH] pyinfra: fix paths --- src/teams_bot/pyinfra.py | 4 ++-- src/teams_bot/pyinfra_assets/teams-bot.profile | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 src/teams_bot/pyinfra_assets/teams-bot.profile diff --git a/src/teams_bot/pyinfra.py b/src/teams_bot/pyinfra.py index a22839a..2771f75 100644 --- a/src/teams_bot/pyinfra.py +++ b/src/teams_bot/pyinfra.py @@ -24,7 +24,7 @@ def deploy_teams_bot(unix_user: str, bot_email: str, bot_passwd: str, dbdir: str if clone_xdcget.changed: server.script( name="Setup virtual environment for teams-bot", - src=importlib.resources.files(__package__).joinpath("setup-venv.sh"), + src=importlib.resources.files(__package__) / "pyinfra_assets" / "setup-venv.sh", _su_user=unix_user, _use_su_login=True, ) @@ -64,7 +64,7 @@ def deploy_teams_bot(unix_user: str, bot_email: str, bot_passwd: str, dbdir: str files.template( name="upload teams-bot systemd unit", - src=importlib.resources.files(__package__).joinpath("teams-bot.service.j2"), + src=importlib.resources.files(__package__) / "pyinfra_assets" / "teams-bot.service.j2", dest=f"/home/{unix_user}/.config/systemd/user/teams-bot.service", user=unix_user, unix_user=unix_user, diff --git a/src/teams_bot/pyinfra_assets/teams-bot.profile b/src/teams_bot/pyinfra_assets/teams-bot.profile deleted file mode 100644 index 4ed2638..0000000 --- a/src/teams_bot/pyinfra_assets/teams-bot.profile +++ /dev/null @@ -1,7 +0,0 @@ -export XDG_RUNTIME_DIR="/run/user/$UID" -export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus" -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm if it exists -[ -s "$HOME/.cargo/env" ] && . "$HOME/.cargo/env" # This loads the cargo environment if it exists -export PATH=$PATH:$HOME/.local/bin -