Skip to content

Commit b684fa4

Browse files
committed
fix(runner): recognize MINGW/MSYS/CYGWIN as Windows in wrapper script
The Unix wrapper script now properly detects Git Bash, MSYS2, and Cygwin environments as Windows and uses the correct Windows binary with .exe extension. Closes #45
1 parent 28040b4 commit b684fa4

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

DESIGN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ set -e
6868
6969
# Detect OS
7070
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
71+
EXT=""
7172
case "$OS" in
7273
linux*) OS="linux" ;;
7374
darwin*) OS="macos" ;;
75+
mingw*|msys*|cygwin*) OS="windows"; EXT=".exe" ;;
7476
*) echo "Error: Unsupported OS: $OS" >&2; exit 1 ;;
7577
esac
7678
@@ -82,7 +84,7 @@ case "$ARCH" in
8284
*) echo "Error: Unsupported architecture: $ARCH" >&2; exit 1 ;;
8385
esac
8486
85-
BINARY="$(dirname "$0")/.rnr/bin/rnr-${OS}-${ARCH}"
87+
BINARY="$(dirname "$0")/.rnr/bin/rnr-${OS}-${ARCH}${EXT}"
8688
8789
if [ ! -f "$BINARY" ]; then
8890
echo "Error: rnr is not configured for ${OS}-${ARCH}." >&2

src/commands/init.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,11 @@ set -e
264264
265265
# Detect OS
266266
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
267+
EXT=""
267268
case "$OS" in
268269
linux*) OS="linux" ;;
269270
darwin*) OS="macos" ;;
271+
mingw*|msys*|cygwin*) OS="windows"; EXT=".exe" ;;
270272
*) echo "Error: Unsupported OS: $OS" >&2; exit 1 ;;
271273
esac
272274
@@ -278,7 +280,7 @@ case "$ARCH" in
278280
*) echo "Error: Unsupported architecture: $ARCH" >&2; exit 1 ;;
279281
esac
280282
281-
BINARY="$(dirname "$0")/.rnr/bin/rnr-${OS}-${ARCH}"
283+
BINARY="$(dirname "$0")/.rnr/bin/rnr-${OS}-${ARCH}${EXT}"
282284
283285
if [ ! -f "$BINARY" ]; then
284286
echo "Error: rnr is not configured for ${OS}-${ARCH}." >&2

0 commit comments

Comments
 (0)