From 9c406c54762ef7958422a0a63fa2363c7eccdc4c Mon Sep 17 00:00:00 2001 From: poka Date: Sat, 5 Dec 2020 03:15:05 +0100 Subject: [PATCH] Use absolute anr real path for .env --- jaklis.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jaklis.py b/jaklis.py index 950e631..2f4f735 100755 --- a/jaklis.py +++ b/jaklis.py @@ -10,10 +10,12 @@ from lib.likes import ReadLikes, SendLikes, UnLikes VERSION = "0.0.1" +MY_PATH = os.path.realpath(os.path.dirname(sys.argv[0])) + '/' + # Get variables environment -if not os.path.isfile('.env'): - copyfile(".env.template", ".env") -dotenv_path = join(dirname(__file__), '.env') +if not os.path.isfile(MY_PATH + '.env'): + copyfile(MY_PATH + ".env.template",MY_PATH + ".env") +dotenv_path = join(dirname(__file__),MY_PATH + '.env') load_dotenv(dotenv_path) # Parse arguments