#!/bin/sh # AirDef: ставит мод и запускает игру (macOS и Linux). Лежит рядом с horizon-client и airdef.hmod. set -e HERE="$(cd "$(dirname "$0")" && pwd)" case "$(uname)" in Darwin) DATA="$HOME/Library/Application Support" ;; *) DATA="${XDG_DATA_HOME:-$HOME/.local/share}" ;; esac GAME="${HORIZON_HOME:-$DATA/horizon}" mkdir -p "$GAME/horizon-mods" cp "$HERE/airdef.hmod" "$GAME/horizon-mods/airdef.hmod" rm -rf "$GAME/horizon-mods/airdef" LIST="$GAME/horizon-mods.txt"; touch "$LIST" grep -v '^mod.airdef:' "$LIST" > "$LIST.tmp" || true; echo 'mod.airdef:true' >> "$LIST.tmp"; mv "$LIST.tmp" "$LIST" RES="${HORIZON_RESOURCES:-$(ls -d "$DATA/horizon-launcher/versions"/*/.local/horizon-client/26.3 2>/dev/null | sort | tail -1)}" [ -n "$RES" ] || { echo "Не найдены ресурсы игры: установи Horizon через лаунчер и запусти его один раз"; exit 1; } xattr -dr com.apple.quarantine "$HERE" 2>/dev/null || true cd "$GAME" exec "$HERE/horizon-client" --resources "$RES" "$@"