mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
chore: add ability to download specific maadeps (#6700)
This commit is contained in:
@@ -95,14 +95,19 @@ def retry_urlopen(*args, **kwargs):
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) == 2:
|
||||
if len(sys.argv) >= 2:
|
||||
target_triplet = sys.argv[1]
|
||||
else:
|
||||
target_triplet = detect_host_triplet()
|
||||
print(f"about to download prebuilt dependency libraries for {target_triplet} of {TARGET_TAG}")
|
||||
|
||||
if len(sys.argv) >= 3:
|
||||
target_tag = sys.argv[2]
|
||||
else:
|
||||
target_tag = TARGET_TAG
|
||||
print(f"about to download prebuilt dependency libraries for {target_triplet} of {target_tag}")
|
||||
if len(sys.argv) == 1:
|
||||
print(f"to specify another triplet, run `{sys.argv[0]} <target triplet>`")
|
||||
print(f"e.g. `{sys.argv[0]} arm64-windows`")
|
||||
print(f"to specify another triplet [and tag], run `{sys.argv[0]} <target triplet> [tag]`")
|
||||
print(f"e.g. `{sys.argv[0]} arm64-windows` or `{sys.argv[0]} arm64-windows 2023-04-24-3`")
|
||||
req = urllib.request.Request("https://api.github.com/repos/MaaAssistantArknights/MaaDeps/releases")
|
||||
token = os.environ.get("GH_TOKEN", os.environ.get("GITHUB_TOKEN", None))
|
||||
if token:
|
||||
@@ -120,7 +125,7 @@ def main():
|
||||
devel_asset = None
|
||||
runtime_asset = None
|
||||
for release in releases:
|
||||
if release["tag_name"] != TARGET_TAG:
|
||||
if release["tag_name"] != target_tag:
|
||||
continue
|
||||
for asset in release["assets"]:
|
||||
target, component = split_asset_name(asset["name"])
|
||||
|
||||
Reference in New Issue
Block a user