#!/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"