mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-26 17:51:54 +01:00
* initial frontend changes and shared google refactoring * gmail connector is reworked * added permission syncing for gmail * tested! * Added tests for gmail connector * fixed tests and mypy * temp fix * testing done! * rename * test fixes maybe? * removed irrelevant tests * anotha one * refactoring changes * refactor finished * maybe these fixes work * dumps * final fixes
17 lines
577 B
Python
17 lines
577 B
Python
import os
|
|
|
|
|
|
def load_env_vars(env_file: str = ".env") -> None:
|
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
env_path = os.path.join(current_dir, env_file)
|
|
try:
|
|
with open(env_path, "r") as f:
|
|
for line in f:
|
|
line = line.strip()
|
|
if line and not line.startswith("#"):
|
|
key, value = line.split("=", 1)
|
|
os.environ[key] = value.strip()
|
|
print("Successfully loaded environment variables")
|
|
except FileNotFoundError:
|
|
print(f"File {env_file} not found")
|