#!/usr/bin/env bash
set -euo pipefail
GOG_DIR="$(cd "$(dirname "$0")" && pwd)"
id="${1:-}"
name="${2:-GOG-Install}"
if [[ -z "${id}" ]]; then
  echo "Использование: $(basename "$0") <BOTTLE_UUID> [имя]"
  bash "${GOG_DIR}/list-bottles.sh"
  exit 1
fi
if [[ "${id}" == "38412122-AAE1-4831-9F2E-6A0EB364B3F9" ]]; then
  echo "❌ Это bottle HoMM-OldenEra (Steam/HoMM). Создайте новый bottle в Whisky."
  exit 1
fi
cat >"${GOG_DIR}/bottle.env" <<EOF
BOTTLE_ID=${id}
BOTTLE_NAME=${name}
EOF
echo "OK: ${GOG_DIR}/bottle.env → ${name} (${id})"
echo "Дальше: bash ${GOG_DIR}/setup-bottle.sh"
