Skip to content

Commit

Permalink
unify download filenames (#6487)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Dec 14, 2023
1 parent b659ea0 commit e992d82
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions release/build.py
Expand Up @@ -89,17 +89,25 @@ def version() -> str:


def operating_system() -> str:
match (platform.system(), platform.machine()):
case ("Windows", _):
return "windows"
case ("Linux", _):
return "linux"
case ("Darwin", "x86_64"):
return "macos-x86_64"
case ("Darwin", "arm64"):
return "macos-arm64"
warnings.warn("Unexpected platform.")
return f"{platform.system()}-{platform.machine()}"
match platform.system():
case "Windows":
system = "windows"
case "Linux":
system = "linux"
case "Darwin":
system = "macos"
case other:
warnings.warn("Unexpected system.")
system = other
match platform.machine():
case "AMD64" | "x86_64":
machine = "x86_64"
case "arm64":
machine = "arm64"
case other:
warnings.warn("Unexpected platform.")
machine = other
return f"{system}-{machine}"


def _pyinstaller(specfile: str) -> None:
Expand Down Expand Up @@ -350,6 +358,11 @@ def report(block, blocksize, total):
installer = DIST_DIR / f"mitmproxy-{version()}-windows-x64-installer.exe"
assert installer.exists()

# unify filenames
installer = installer.rename(
installer.with_name(installer.name.replace("x64", "x86_64"))
)

print("Run installer...")
subprocess.run(
[installer, "--mode", "unattended", "--unattendedmodeui", "none"], check=True
Expand Down

0 comments on commit e992d82

Please sign in to comment.