resolve config.json root path

This commit is contained in:
Omar Sánchez
2021-10-20 12:43:51 +02:00
parent 40c574f4fc
commit 9859ccde8a

View File

@@ -15,6 +15,7 @@
# Importamos librerias
import json
from datetime import datetime
import os
import pytz
import requests
@@ -62,7 +63,8 @@ class AutoFicher():
exit(20)
def loadConfig(self):
path = 'config.json'
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
path = os.path.join(ROOT_DIR, 'config.json')
if args.config:
path = args.config