fix(torrent_api): load env from execution dir
This commit is contained in:
1 parent
a350796ccb
commit
fec627a7c1
2 files changed
+10
-8
No files matched your search
@@ -1,14 +1,8 @@
|
||||
#!/home/lucas/scripts/torrent_api/.venv/bin/python
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from torrent_api.cli import main
|
||||
|
||||
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())
|
||||
Reference in new issue
Block a user