From c7376e6d83bd99cc80e9da66adf48d91f8720f98 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Feb 2023 17:50:06 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Improve=20config.ini=20example?= =?UTF-8?q?=20fetch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/configuration.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/configuration.py b/buildroot/share/PlatformIO/scripts/configuration.py index 7a07f02d4605..3fc43ed6d89a 100644 --- a/buildroot/share/PlatformIO/scripts/configuration.py +++ b/buildroot/share/PlatformIO/scripts/configuration.py @@ -88,6 +88,7 @@ def fetch_example(url): if not url.startswith('http'): brch = "bugfix-2.1.x" if '@' in url: url, brch = map(str.strip, url.split('@')) + if url == 'examples/default': url = 'default' url = f"https://raw.githubusercontent.com/MarlinFirmware/Configurations/{brch}/config/{url}" url = url.replace("%", "%25").replace(" ", "%20") @@ -103,7 +104,7 @@ def fetch_example(url): import os # Reset configurations to default - os.system("git reset --hard HEAD") + os.system("git checkout HEAD Marlin/*.h") # Try to fetch the remote files gotfile = False @@ -191,7 +192,7 @@ def apply_config_ini(cp): # For 'examples/' fetch an example set from GitHub. # For https?:// do a direct fetch of the URL. - if ckey.startswith('examples/') or ckey.startswith('http:'): + if ckey.startswith('examples/') or ckey.startswith('http'): fetch_example(ckey) ckey = 'base'