Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 50dd647

Browse files
committed
If no .env file is found locally, search for it
1 parent 5f5bcba commit 50dd647

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

runregistry/runregistry.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
)
1212

1313
# Look for .env file in the directory of the caller
14-
# first.
15-
load_dotenv(dotenv_path=os.path.join(os.getcwd(), ".env"))
14+
# first. If it exists, use it.
15+
if os.path.exists(os.path.join(os.getcwd(), ".env")):
16+
load_dotenv(dotenv_path=os.path.join(os.getcwd(), ".env"))
17+
else:
18+
load_dotenv()
1619

1720

1821
# Silence unverified HTTPS warning:

0 commit comments

Comments
 (0)