0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-19 08:08:25 +00:00

🔨 Fix config.ini URL fetch (#25313)

This commit is contained in:
Darren Garnier 2023-01-30 23:00:49 -05:00 committed by GitHub
parent 0c181fc9d3
commit d0a965a1df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,12 +85,11 @@ def apply_opt(name, val, conf=None):
# Return True if any files were fetched. # Return True if any files were fetched.
def fetch_example(url): def fetch_example(url):
if url.endswith("/"): url = url[:-1] if url.endswith("/"): url = url[:-1]
if url.startswith('http'): if not url.startswith('http'):
url = url.replace("%", "%25").replace(" ", "%20")
else:
brch = "bugfix-2.1.x" 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 = f"https://raw.githubusercontent.com/MarlinFirmware/Configurations/{brch}/config/{url}"
url = url.replace("%", "%25").replace(" ", "%20")
# Find a suitable fetch command # Find a suitable fetch command
if shutil.which("curl") is not None: if shutil.which("curl") is not None: