mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
gnu compare: try to use a local copy if the download failed
This commit is contained in:
parent
78405e6a30
commit
217aa3bd9d
1 changed files with 15 additions and 4 deletions
|
@ -11,10 +11,21 @@ import json
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
base = "../gnu/tests/"
|
base = "../gnu/tests/"
|
||||||
urllib.request.urlretrieve(
|
|
||||||
|
# Try to download the file, use local copy if download fails
|
||||||
|
result_json = "result.json"
|
||||||
|
try:
|
||||||
|
urllib.request.urlretrieve(
|
||||||
"https://raw.githubusercontent.com/uutils/coreutils-tracking/main/gnu-full-result.json",
|
"https://raw.githubusercontent.com/uutils/coreutils-tracking/main/gnu-full-result.json",
|
||||||
"result.json",
|
result_json
|
||||||
)
|
)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Failed to download the file: {e}")
|
||||||
|
if not os.path.exists(result_json):
|
||||||
|
print(f"Local file '{result_json}' not found. Exiting.")
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
print(f"Using local file '{result_json}'.")
|
||||||
|
|
||||||
types = ("/*/*.sh", "/*/*.pl", "/*/*.xpl")
|
types = ("/*/*.sh", "/*/*.pl", "/*/*.xpl")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue