Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.ini fetch examples fix #25313

Merged
merged 2 commits into from
Jan 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions buildroot/share/PlatformIO/scripts/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,12 @@ def apply_opt(name, val, conf=None):
# Return True if any files were fetched.
def fetch_example(url):
if url.endswith("/"): url = url[:-1]
if url.startswith('http'):
url = url.replace("%", "%25").replace(" ", "%20")
else:
if not url.startswith('http'):
brch = "bugfix-2.1.x"
if '@' in path: path, brch = map(str.strip, path.split('@'))
if '@' in url: url, brch = map(str.strip, url.split('@'))
url = f"https://raw.githubusercontent.com/MarlinFirmware/Configurations/{brch}/config/{url}"

url = url.replace("%", "%25").replace(" ", "%20")

# Find a suitable fetch command
if shutil.which("curl") is not None:
fetch = "curl -L -s -S -f -o"
Expand Down