mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-07-16 03:07:47 -06:00
🔨 Improve config.ini example fetch
This commit is contained in:
parent
579833e2a3
commit
894e378702
1 changed files with 3 additions and 2 deletions
|
@ -88,6 +88,7 @@ def fetch_example(url):
|
||||||
if not url.startswith('http'):
|
if not url.startswith('http'):
|
||||||
brch = "bugfix-2.1.x"
|
brch = "bugfix-2.1.x"
|
||||||
if '@' in url: url, brch = map(str.strip, url.split('@'))
|
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 = f"https://raw.githubusercontent.com/MarlinFirmware/Configurations/{brch}/config/{url}"
|
||||||
url = url.replace("%", "%25").replace(" ", "%20")
|
url = url.replace("%", "%25").replace(" ", "%20")
|
||||||
|
|
||||||
|
@ -103,7 +104,7 @@ def fetch_example(url):
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# Reset configurations to default
|
# Reset configurations to default
|
||||||
os.system("git reset --hard HEAD")
|
os.system("git checkout HEAD Marlin/*.h")
|
||||||
|
|
||||||
# Try to fetch the remote files
|
# Try to fetch the remote files
|
||||||
gotfile = False
|
gotfile = False
|
||||||
|
@ -191,7 +192,7 @@ def apply_config_ini(cp):
|
||||||
|
|
||||||
# For 'examples/<path>' fetch an example set from GitHub.
|
# For 'examples/<path>' fetch an example set from GitHub.
|
||||||
# For https?:// do a direct fetch of the URL.
|
# 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)
|
fetch_example(ckey)
|
||||||
ckey = 'base'
|
ckey = 'base'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue