From e889a4dc733cc8ce83deff5c6848d6814e9781be Mon Sep 17 00:00:00 2001 From: Lucas Vivo Date: Mon, 23 Nov 2026 14:37:09 +0100 Subject: [PATCH] fix(torrent_api): move load_env to main --- torrent_api/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/torrent_api/main.py b/torrent_api/main.py index a491f28..37b1d38 100755 --- a/torrent_api/main.py +++ b/torrent_api/main.py @@ -7,9 +7,8 @@ from dotenv import load_dotenv from torrent_api.cli import main -working_env = Path.cwd() / ".env" -execution_env = Path(__file__).resolve().parent / ".env" -load_dotenv(working_env if working_env.is_file() else execution_env) - if __name__ == "__main__": + working_env = Path.cwd() / ".env" + execution_env = Path(__file__).resolve().parent / ".env" + load_dotenv(working_env if working_env.is_file() else execution_env) sys.exit(main())