Skip to content

Commit

Permalink
🔨 Improve config.ini example fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and EvilGremlin committed Apr 8, 2023
1 parent cb832ed commit 30a5c22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions buildroot/share/PlatformIO/scripts/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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
Expand Down Expand Up @@ -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'

Expand Down

0 comments on commit 30a5c22

Please sign in to comment.