Skip to content

Commit 4213997

Browse files
thinkyheadernisv
authored andcommitted
🔨 Improve config.ini example fetch
1 parent e2b1d7d commit 4213997

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

buildroot/share/PlatformIO/scripts/configuration.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def fetch_example(url):
8888
if not url.startswith('http'):
8989
brch = "bugfix-2.1.x"
9090
if '@' in url: url, brch = map(str.strip, url.split('@'))
91+
if url == 'examples/default': url = 'default'
9192
url = f"https://raw.githubusercontent.com/MarlinFirmware/Configurations/{brch}/config/{url}"
9293
url = url.replace("%", "%25").replace(" ", "%20")
9394

@@ -103,7 +104,7 @@ def fetch_example(url):
103104
import os
104105

105106
# Reset configurations to default
106-
os.system("git reset --hard HEAD")
107+
os.system("git checkout HEAD Marlin/*.h")
107108

108109
# Try to fetch the remote files
109110
gotfile = False
@@ -191,7 +192,7 @@ def apply_config_ini(cp):
191192

192193
# For 'examples/<path>' fetch an example set from GitHub.
193194
# For https?:// do a direct fetch of the URL.
194-
if ckey.startswith('examples/') or ckey.startswith('http:'):
195+
if ckey.startswith('examples/') or ckey.startswith('http'):
195196
fetch_example(ckey)
196197
ckey = 'base'
197198

0 commit comments

Comments
 (0)