Windows fixes for download_dtk.py and shasum

This commit is contained in:
Luke Street 2022-11-27 23:56:22 -05:00
parent 607753a08f
commit 89e083cc54
3 changed files with 9 additions and 8 deletions

View File

@ -1464,7 +1464,7 @@ if __name__ == "__main__":
n.comment("Check DOL hash")
n.rule(
name="check",
command=ALLOW_CHAIN + "$dtk shasum -c $in && touch $out",
command="$dtk shasum -c $in -o $out",
description="CHECK $in",
)
n.build(

View File

@ -1 +1 @@
v0.1.0
v0.1.1

View File

@ -2,6 +2,7 @@ import argparse
import urllib.request
import os
import stat
import platform
from pathlib import Path
REPO = "https://github.com/encounter/decomp-toolkit"
@ -16,18 +17,18 @@ def main():
with open(args.tag_file, "r") as f:
tag = f.readline().rstrip()
uname = os.uname()
uname = platform.uname()
suffix = ""
platform = uname.sysname.lower()
if platform == "darwin":
platform = "macos"
elif platform == "windows":
system = uname.system.lower()
if system == "darwin":
system = "macos"
elif system == "windows":
suffix = ".exe"
arch = uname.machine.lower()
if arch == "amd64":
arch = "x86_64"
url = f"{REPO}/releases/download/{tag}/dtk-{platform}-{arch}{suffix}"
url = f"{REPO}/releases/download/{tag}/dtk-{system}-{arch}{suffix}"
output = args.output
# print(f"Downloading {url} to {output}")
urllib.request.urlretrieve(url, output)