#!/usr/bin/env bash set -euo pipefail BUNDLE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" TARGET_ROOT="${1:-$HOME/workspace/teddybear_openpi}" mkdir -p "$TARGET_ROOT" mkdir -p "$TARGET_ROOT/openpi" mkdir -p "$TARGET_ROOT/sim" if ! command -v uv >/dev/null 2>&1; then curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="$HOME/.cargo/bin:$PATH" fi if ! command -v hf >/dev/null 2>&1; then curl -LsSf https://hf.co/cli/install.sh | bash -s fi if [[ -n "${HF_TOKEN:-}" ]]; then hf auth whoami >/dev/null 2>&1 || hf auth login --token "$HF_TOKEN" fi cp -a "$BUNDLE_ROOT/code/openpi/." "$TARGET_ROOT/openpi/" cp -a "$BUNDLE_ROOT/sim/." "$TARGET_ROOT/sim/" cd "$TARGET_ROOT/openpi" uv sync --frozen . .venv/bin/activate pip install scipy opencv-python-headless echo "$TARGET_ROOT"