#!/usr/bin/env bash # Install stock Plushie renderer into bin/ (avoids broken plushie tool 404). set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" VERSION="${PLUSHIE_RUST_VERSION:-0.7.1}" # gleam.toml plushie_rust_version if present if [[ -f gleam.toml ]]; then v="$(grep -E '^plushie_rust_version' gleam.toml | head -1 | sed -E 's/.*"([^"]+)".*/\1/')" if [[ -n "$v" ]]; then VERSION="$v" fi fi ARCH="$(uname -m)" OS="$(uname -s | tr '[:upper:]' '[:lower:]')" case "$ARCH" in x86_64|amd64) ARCH=x86_64 ;; aarch64|arm64) ARCH=aarch64 ;; esac case "$OS" in linux) PLATFORM=linux ;; darwin) PLATFORM=darwin ;; *) echo "unsupported os: $OS" >&2; exit 1 ;; esac NAME="plushie-renderer-${PLATFORM}-${ARCH}" URL="https://github.com/plushie-ui/plushie-rust/releases/download/v${VERSION}/${NAME}" mkdir -p bin echo "Downloading $URL ..." curl -fsSL -o bin/plushie-renderer "$URL" chmod +x bin/plushie-renderer echo "Installed bin/plushie-renderer" file bin/plushie-renderer