#!/bin/zsh
set -euo pipefail

SRC="/Users/metawaterspirit/Library/Mobile Documents/com~apple~CloudDocs/App coding/DecorDrops"
DST="/Applications/World of Warcraft/_retail_/Interface/AddOns/DecorDrops"

echo "Checking DecorDrops live sync..."
echo "Source: $SRC"
echo "Target: $DST"

if [[ ! -e "$DST" ]]; then
  echo "FAIL: Target path does not exist."
  exit 1
fi

if [[ ! -L "$DST" ]]; then
  echo "FAIL: Target exists but is not a symlink."
  exit 1
fi

LINK_TARGET="$(readlink "$DST")"
if [[ "$LINK_TARGET" != "$SRC" ]]; then
  echo "FAIL: Symlink points to:"
  echo "  $LINK_TARGET"
  echo "Expected:"
  echo "  $SRC"
  exit 1
fi

echo "PASS: Live sync is active."
echo "Any file changes in DecorDrops are loaded on /reload in-game."
