-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrnr
More file actions
30 lines (25 loc) · 702 Bytes
/
rnr
File metadata and controls
30 lines (25 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
set -e
# Detect OS
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
EXT=""
case "$OS" in
linux*) OS="linux" ;;
darwin*) OS="macos" ;;
mingw*|msys*|cygwin*) OS="windows"; EXT=".exe" ;;
*) echo "Error: Unsupported OS: $OS" >&2; exit 1 ;;
esac
# Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64|amd64) ARCH="amd64" ;;
arm64|aarch64) ARCH="arm64" ;;
*) echo "Error: Unsupported architecture: $ARCH" >&2; exit 1 ;;
esac
BINARY="$(dirname "$0")/.rnr/bin/rnr-${OS}-${ARCH}${EXT}"
if [ ! -f "$BINARY" ]; then
echo "Error: rnr is not configured for ${OS}-${ARCH}." >&2
echo "Run 'rnr init --add-platform ${OS}-${ARCH}' to add support." >&2
exit 1
fi
exec "$BINARY" "$@"