#!/usr/bin/env bash set -uo pipefail BASE_DIR="${TMPDIR:-/tmp}" DIR="$BASE_DIR/latex-benchmark" REPO="https://web.itp3.uni-stuttgart.de/latex-benchmark/latex-benchmark.git" if ! command -v git >/dev/null 2>&1; then printf 'git was not found. Install git or clone the repository manually.\n' >&2 exit 1 fi if [[ -d "$DIR/.git" ]]; then printf 'Updating benchmark in %s ...\n' "$DIR" if ! git -C "$DIR" pull --ff-only; then printf 'Could not update %s. Remove that directory and try again.\n' "$DIR" >&2 exit 1 fi else printf 'Cloning benchmark into %s ...\n' "$DIR" if ! git clone "$REPO" "$DIR"; then printf 'Could not clone benchmark repository.\n' >&2 exit 1 fi fi cd "$DIR" || exit 1 ./latex-benchmark.sh