mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-02-17 06:48:05 +00: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'):
|
||||
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/<path>' 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'
|
||||
|
||||
|
|
Loading…
Reference in a new issue