diff --git a/README.md b/README.md index df85e03..2197908 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ Puts the catalog into RetroArch's library: two playlists — *Teletype Games - Commodore 64* and *Teletype Games - TIC-80* — with box art, on any machine RetroArch runs on. -This repository is only the store definition — `config.json` plus a wrapper -installer. All the logic lives in the shared engine, -[`warp-engine-retroarch-store`](https://git.teletypegames.org/tools/warp-engine-retroarch-store), +This repository is only the store definition — `config.json` plus the two wrapper +scripts. All the logic lives in the shared engine, +[`warp-engine-retroarch-store`](https://git.teletypegames.org/stores/warp-engine-retroarch-store), which works with any WarpEngine-based site; this is just the Teletype Games configuration of it. ## Install ```sh -curl -fsSL https://git.teletypegames.org/tools/ttg-retroarch-store/raw/branch/master/install.sh | bash +curl -fsSL https://git.teletypegames.org/stores/ttg-retroarch-store/raw/branch/master/install.sh | sh ``` Or from a checkout of this repo: @@ -55,6 +55,25 @@ Keep it current from `crontab`: 0 * * * * ~/.local/bin/ttg-retroarch-store sync >>~/.local/share/warp-engine-store/ttg/store.log 2>&1 ``` +## Uninstall + +```sh +curl -fsSL https://git.teletypegames.org/stores/ttg-retroarch-store/raw/branch/master/uninstall.sh | sh +``` + +Or `./uninstall.sh` from a checkout. It takes out the six games, the two +playlists and their thumbnails, then the launcher and the store home. Close +RetroArch first, for the same reason as for a sync. + +```sh +DRY_RUN=1 ./uninstall.sh # show what would go, remove nothing +KEEP_HOME=1 ./uninstall.sh # keep state.json and the log, for a reinstall +``` + +Nothing of yours goes with it: content you put in the `teletypegames/` folder +keeps its directory, a playlist that still has an entry of yours is rewritten +rather than deleted, and any `*.lpl.ttg-backup` is listed and left alone. + ## What this store installs | Catalog platform | Playlist | Core | Extension | @@ -73,7 +92,7 @@ Statuses `released` and `archived`, whole catalog, no owner filter — **six tit That is the cartridge half of the catalog. Our other games are native builds and web builds, and no libretro core runs those — on a Batocera box they install as Ports instead, see -[`ttg-batocera-store`](https://git.teletypegames.org/tools/ttg-batocera-store). +[`ttg-batocera-store`](https://git.teletypegames.org/stores/ttg-batocera-store). Everything lands under the `teletypegames/` subfolder of RetroArch's content directory, so a prune can never reach content you put there yourself. To change diff --git a/install.sh b/install.sh index 1d35ffd..a5d7dc6 100755 --- a/install.sh +++ b/install.sh @@ -1,10 +1,33 @@ -#!/bin/bash +#!/bin/sh # Install the Teletype Games store into this machine's RetroArch. # -# bash <(curl -fsSL https://git.teletypegames.org/tools/ttg-retroarch-store/raw/branch/master/install.sh) +# curl -fsSL https://git.teletypegames.org/stores/ttg-retroarch-store/raw/branch/master/install.sh | sh # -# All the work is done by the engine's installer; this only says which store. -set -euo pipefail -ENGINE_RAW_BASE="${ENGINE_RAW_BASE:-https://git.teletypegames.org/tools/warp-engine-retroarch-store/raw/branch/master}" -export STORE_CONFIG="${STORE_CONFIG:-https://git.teletypegames.org/tools/ttg-retroarch-store/raw/branch/master/config.json}" -curl -fsSL "$ENGINE_RAW_BASE/install.sh" | bash +# 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" diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..0901bfe --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Remove the Teletype Games store from this machine's RetroArch. +# +# curl -fsSL https://git.teletypegames.org/stores/ttg-retroarch-store/raw/branch/master/uninstall.sh | sh +# +# All the work is done by the engine's uninstaller; this only says which store. +# DRY_RUN=1 to see what would go, KEEP_HOME=1 to keep the state and the log. +set -eu +FORGE="${FORGE:-https://git.teletypegames.org/stores}" +ENGINE_RAW_BASE="${ENGINE_RAW_BASE:-$FORGE/warp-engine-retroarch-store/raw/branch/master}" +STORE_ID="${STORE_ID:-ttg}" +export STORE_ID + +TMP="$(mktemp)" +trap 'rm -f "$TMP"' EXIT +curl -fsSL "$ENGINE_RAW_BASE/uninstall.sh" -o "$TMP" +sh "$TMP"