Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterain98 committed Dec 18, 2023
1 parent 258ddfd commit be7ef8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

dotenv_exists = os.path.exists(".env")
if not dotenv_exists:
print("Please create .env file first.")
exit(1)
print("No .env file found.")
for env in ["ALIST_HOST", "ALIST_USERNAME", "ALIST_PASSWORD"]:
if env not in os.environ:
print(f"{env} is not found in the environment variables.")
load_dotenv()
client = AlistClient(os.getenv("ALIST_HOST"), os.getenv("ALIST_USERNAME"), os.getenv("ALIST_PASSWORD"))

Expand Down

0 comments on commit be7ef8c

Please sign in to comment.