mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2026-01-07 15:17:42 -07:00
🔨 Fix configuration.py URL fetch (#28208)
This commit is contained in:
parent
3551a2613d
commit
ef2fbcd2b6
1 changed files with 4 additions and 4 deletions
|
|
@ -3,7 +3,7 @@
|
|||
# configuration.py
|
||||
# Apply options from config.ini to the existing Configuration headers
|
||||
#
|
||||
import re, os, shutil, configparser, datetime
|
||||
import re, os, shutil, subprocess, configparser, datetime
|
||||
from pathlib import Path
|
||||
|
||||
verbose = 0
|
||||
|
|
@ -149,9 +149,9 @@ def fetch_example(url):
|
|||
|
||||
# Find a suitable fetch command
|
||||
if shutil.which("curl") is not None:
|
||||
fetch = "curl -L -s -S -f -o"
|
||||
fetch = [ "curl", "-L", "-s", "-S", "-f", "-o" ]
|
||||
elif shutil.which("wget") is not None:
|
||||
fetch = "wget -q -O"
|
||||
fetch = [ "wget", "-q", "-O" ]
|
||||
else:
|
||||
blab("Couldn't find curl or wget", -1)
|
||||
#blab("Couldn't find curl or wget", 0)
|
||||
|
|
@ -165,7 +165,7 @@ def fetch_example(url):
|
|||
# Try to fetch the remote files
|
||||
gotfile = False
|
||||
for fn in ("Configuration.h", "Configuration_adv.h", "_Bootscreen.h", "_Statusscreen.h"):
|
||||
if os.system(f"{fetch} wgot {url}/{fn} >/dev/null 2>&1") == 0:
|
||||
if subprocess.call(fetch + [ "wgot", f"{url}/{fn}" ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) == 0:
|
||||
shutil.move('wgot', config_path(fn))
|
||||
gotfile = True
|
||||
blab(f"Fetched {fn}", 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue