def update_config(config_path, versions):
content = ""
- with open(config_path, "r") as file:
+ with open(str(config_path), "r") as file:
content = file.read()
content = re.sub("versions:[\\s]*{[^}]*}", "versions: {}".format(versions), content)
- with open(config_path, "w+") as file:
+ with open(str(config_path), "w+") as file:
file.write(content)
profiles = {}
for ppath in Path(path).rglob("profiles.json"):
- with open(ppath, "r") as file:
+ with open(str(ppath), "r") as file:
profiles[ppath] = file.read()
if len(profiles) == 0:
profiles = {}
def add_path(path):
- with open(path, "r") as file:
+ with open(str(path), "r") as file:
profiles[path] = file.read()
for path in input_paths:
profiles = {}
for ppath in Path(path).rglob("profiles.json"):
- with open(ppath, "r", encoding="utf-8") as file:
+ with open(str(ppath), "r", encoding="utf-8") as file:
profiles[ppath] = file.read()
if len(profiles) == 0: