Fix location issue under windows.

This patch fix https://github.com/StevenBlack/hosts/issues/1166#issuecomment-634686875
This commit is contained in:
funilrys
2020-06-07 18:28:32 +02:00
parent 6a216bf28d
commit 5798b17132

View File

@ -1210,6 +1210,11 @@ def update_readme_data(readme_file, **readme_updates):
readme_data = json.load(f)
readme_data[extensions_key] = generation_data
for denomination, data in readme_data.copy().items():
if "location" in data and data["location"] and "\\" in data["location"]:
# Windows compatibility: #1166
readme_data[denomination]["location"] = data["location"].replace("\\", "/")
with open(readme_file, "w") as f:
json.dump(readme_data, f)