From 60f38576620e993e06fc19166cb3d68f275096e6 Mon Sep 17 00:00:00 2001 From: Darren Garnier Date: Mon, 30 Jan 2023 23:00:49 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Fix=20config.ini=20URL=20fetch?= =?UTF-8?q?=20(#25313)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/configuration.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/configuration.py b/buildroot/share/PlatformIO/scripts/configuration.py index d752ebc2c828..42fc91038ecc 100644 --- a/buildroot/share/PlatformIO/scripts/configuration.py +++ b/buildroot/share/PlatformIO/scripts/configuration.py @@ -85,13 +85,12 @@ def apply_opt(name, val, conf=None): # Return True if any files were fetched. def fetch_example(url): if url.endswith("/"): url = url[:-1] - if url.startswith('http'): - url = url.replace("%", "%25").replace(" ", "%20") - else: + if not url.startswith('http'): brch = "bugfix-2.1.x" - if '@' in path: path, brch = map(str.strip, path.split('@')) + if '@' in url: url, brch = map(str.strip, url.split('@')) url = f"https://raw.githubusercontent.com/MarlinFirmware/Configurations/{brch}/config/{url}" - + url = url.replace("%", "%25").replace(" ", "%20") + # Find a suitable fetch command if shutil.which("curl") is not None: fetch = "curl -L -s -S -f -o"