Need to check if env file exists, otherwise it errors
This commit is contained in:
parent
c9f7ab8f92
commit
42ba2be0f8
@ -18,9 +18,10 @@ if not DOWNLOAD_PATH:
|
|||||||
DOWNLOAD_PATH = "./downloads"
|
DOWNLOAD_PATH = "./downloads"
|
||||||
|
|
||||||
# Read in dot env file
|
# Read in dot env file
|
||||||
file = open(".env", "r")
|
if os.path.exists(".env"):
|
||||||
lines = file.readlines()
|
file = open(".env", "r")
|
||||||
for line in lines:
|
lines = file.readlines()
|
||||||
|
for line in lines:
|
||||||
key, value = line.split("=")
|
key, value = line.split("=")
|
||||||
key = key.strip()
|
key = key.strip()
|
||||||
if os.environ.get(key) is None:
|
if os.environ.get(key) is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user