#!/usr/bin/env bash # SPDX-License-Identifier: MIT # The reference, sn76489-python, at the pin, into external/sn76489-python. It imports nothing, # so no venv: the scripts run it with PYTHONPATH. PyPy is used when found. # Usage: scripts/fetch_sn76489python.sh [source repo, default ../sn76489-python] # The source defaults to the checkout beside this one; its git-ignored reference/ (fetched # third-party files) is not cloned. set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) PIN=3c5d703530cb59e00b19b259ca4d1b1f55e4bf2d SRC=${1:-"$ROOT/../sn76489-python"} DEST="$ROOT/external/sn76489-python" mkdir -p "$ROOT/external" [ -d "$DEST/.git" ] || git clone -q "$SRC" "$DEST" git -C "$DEST" fetch -q origin 2>/dev/null || true git -C "$DEST" checkout -q "$PIN" echo "sn76489-python at $(git -C "$DEST" rev-parse --short HEAD) in $DEST"