From 0891ee8748f7cf3876ba8d1c3a6ba4ed481a0f58 Mon Sep 17 00:00:00 2001 From: Arsenii Esenin Date: Thu, 6 Aug 2020 17:32:35 +0200 Subject: [PATCH] Fixed config dir --- __main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/__main__.py b/__main__.py index 30da672..3c6367c 100644 --- a/__main__.py +++ b/__main__.py @@ -2,16 +2,17 @@ import requests import logging import json +import pathlib logging.basicConfig(level=logging.INFO) config = {} -with open("./config.json", "r") as f: +with open(str(pathlib.Path(__file__).parent / "config.json"), "r") as f: config = json.loads(f.read()) -base_file_url = "https://raw.githubusercontent.com/{}}/{}/master/".format(config["owner"], config["repo"]) +base_file_url = "https://raw.githubusercontent.com/{}/{}/master/".format(config["owner"], config["repo"]) tree = requests.get("https://api.github.com/repos/{}/{}/git/trees/master?recursive=1" .format(config["owner"], config["repo"])) tree = tree.json()["tree"]