Add python-dotenv

This commit is contained in:
sonny 2020-12-27 16:48:06 +01:00
parent 3b4784dcb2
commit 403bd89ca2
4 changed files with 29 additions and 4 deletions

View file

@ -0,0 +1,7 @@
from pathlib import Path
from dotenv import load_dotenv
env_path = Path("..") / ".env"
load_dotenv(dotenv_path=env_path)

View file

@ -4,6 +4,8 @@ from ip_listener.main import detect
@click.command()
@click.argument()
def run():
detect()
@click.argument("domains", envvar="DOMAIN", nargs=-1)
@click.argument("token", envvar="TOKEN")
@click.option("--read-only", envvar="READ_ONLY", default=False)
def run(domains, token):
detect(domains, token)