mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-10-10 23:12:30 +02:00
error handling if no .env file is provided
This commit is contained in:
4
main.py
4
main.py
@@ -146,6 +146,10 @@ def playground():
|
||||
|
||||
if __name__ == '__main__':
|
||||
env_path = Path('.env')
|
||||
if not env_path.is_file():
|
||||
with open('.env', 'w') as f:
|
||||
print("Wrting new .env file")
|
||||
f.write('')
|
||||
if env_path.is_file():
|
||||
print(f'loading environment from {env_path.resolve()}')
|
||||
dotenv.load_dotenv(env_path, verbose=True, override=True)
|
||||
|
Reference in New Issue
Block a user