#!/usr/bin/env bash
set -euo pipefail
echo "Whisky bottles (franke):"
for meta in "${HOME}/Library/Containers/com.franke.Whisky/Bottles/"*/Metadata.plist; do
  [[ -f "${meta}" ]] || continue
  id="$(basename "$(dirname "${meta}")")"
  name="$(plutil -extract info.name raw "${meta}" 2>/dev/null || echo "?")"
  du -sh "$(dirname "${meta}")" 2>/dev/null | awk -v id="${id}" -v n="${name}" '{printf "  %s  %-20s  %s\n", id, n, $1}'
done
echo ""
echo "Привязать GOG: bash $(dirname "$0")/use-bottle.sh <UUID> [имя]"
