Fix location issue under windows.
authorfunilrys <redacted>
Sun, 7 Jun 2020 16:28:32 +0000 (18:28 +0200)
committerfunilrys <redacted>
Sun, 7 Jun 2020 16:28:32 +0000 (18:28 +0200)
This patch fix https://github.com/StevenBlack/hosts/issues/1166#issuecomment-634686875

updateHostsFile.py

index 5df7978e19b86ad892c599043484c2721feef254..7a486ab2d0b53124e997be528c7b5c86b9554320 100644 (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)
 
git clone https://git.99rst.org/PROJECT