Skip to content

fix: Windows platform detection in download-ways.sh #4

@maheshkeswani-source

Description

@maheshkeswani-source

Problem

tools/ways-cli/download-ways.sh uses uname -s for platform detection, which returns mingw64_nt-10.0-26200 on Git Bash for Windows instead of the expected windows. This causes the script to look for a binary named ways-mingw64_nt-10.0-26200-x86_64, which doesn't exist in the release, even though ways-windows-x86_64.exe is available.

Observed behavior:

Platform: mingw64_nt-10.0-26200-x86_64
Release:  ways-v0.3.1
No pre-built binary for mingw64_nt-10.0-26200-x86_64 in release ways-v0.3.1.

Expected behavior: Script detects Windows and downloads ways-windows-x86_64.exe.

Fix

Add Windows normalization in the platform detection block:

OS=$(uname -s | tr '[:upper:]' '[:lower:]')
# Normalize Windows environments (Git Bash, MSYS2, Cygwin)
case "$OS" in
  mingw*|msys*|cygwin*) OS="windows" ;;
esac
ARCH=$(uname -m | sed 's/arm64/aarch64/')
PLATFORM="${OS}-${ARCH}"

Also update OUTPUT_FILE to append .exe on Windows:

EXE_EXT=""
[[ "$OS" == "windows" ]] && EXE_EXT=".exe"
OUTPUT_FILE="${OUTPUT_DIR}/ways${EXE_EXT}"

Environment

  • Windows 11 Home 10.0.26200
  • Git Bash (mingw64)
  • gh CLI v2.89.0
  • No WSL, no Rust toolchain

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions