Files
mr.zeroandClaude Opus 5 66ddf87d03 Add an uninstall wrapper, and move to the stores org
uninstall.sh mirrors install.sh: it names the store and lets the engine do the
work, passing STORE_ID rather than a config URL. install.sh gained what the
Batocera wrapper already had — run from a checkout, it uses the config next to
it rather than the one on the forge.

Both wrappers are POSIX sh now, and neither pipes curl into a shell any more: a
failed download would feed an empty script to sh and look like success, so the
installer is fetched to a file and run from there.

The repository moved from the tools org to stores. The old raw URLs still
redirect.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 08:32:47 +02:00

34 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# Install the Teletype Games store into this machine's RetroArch.
#
# curl -fsSL https://git.teletypegames.org/stores/ttg-retroarch-store/raw/branch/master/install.sh | sh
#
# All the work is done by the shared engine; this script only says which store
# to install. See https://git.teletypegames.org/stores/warp-engine-retroarch-store
#
set -eu
FORGE="${FORGE:-https://git.teletypegames.org/stores}"
ENGINE_RAW_BASE="${ENGINE_RAW_BASE:-$FORGE/warp-engine-retroarch-store/raw/branch/master}"
# Only set when run as a file; piped from curl "$0" is `sh`, and then nothing
# may come from whatever the cwd happens to hold.
SRC_DIR=""
if [ -f "$0" ]; then
SRC_DIR="$(cd "$(dirname "$(readlink -f "$0" 2>/dev/null || echo "$0")")" && pwd)"
fi
# Prefer the config next to this script when run from a checkout.
if [ -z "${STORE_CONFIG:-}" ] && [ -n "$SRC_DIR" ] && [ -f "$SRC_DIR/config.json" ]; then
STORE_CONFIG="$SRC_DIR/config.json"
else
STORE_CONFIG="${STORE_CONFIG:-$FORGE/ttg-retroarch-store/raw/branch/master/config.json}"
fi
export STORE_CONFIG ENGINE_RAW_BASE
# Fetched to a file rather than piped into a shell: a failed download must fail
# loudly instead of feeding an empty script to sh, which would look like success.
TMP="$(mktemp)"
trap 'rm -f "$TMP"' EXIT
curl -fsSL "$ENGINE_RAW_BASE/install.sh" -o "$TMP"
sh "$TMP"