#!/usr/bin/env bash set -euo pipefail # Installs/syncs the AscensionExporter addon into your WoW Ascension AddOns folder. # Default target: /srv/add01/wow-ascension/Interface/AddOns # Usage: # scripts/install_addon_sub.sh [TARGET_ADDONS_DIR] # Example: # scripts/install_addon_sub.sh /srv/add01/wow-ascension/Interface/AddOns SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="${SCRIPT_DIR}/.." SRC="${REPO_ROOT}/AscensionExporter" DEST_BASE="${1:-/srv/add01/wow-ascension/Interface/AddOns}" DEST="${DEST_BASE}/AscensionExporter" if [[ ! -d "${SRC}" ]]; then echo "ERROR: Source addon folder not found at: ${SRC}" >&2 exit 1 fi echo "Installing AscensionExporter from: ${SRC}" echo "Target AddOns directory: ${DEST_BASE}" mkdir -p "${DEST_BASE}" if command -v rsync >/dev/null 2>&1; then echo "Using rsync to copy files..." rsync -a --delete "${SRC}/" "${DEST}/" else echo "rsync not found; using cp -a" mkdir -p "${DEST}" # Copy contents of SRC into DEST, preserving attributes cp -a "${SRC}/." "${DEST}/" fi echo "Done. Addon installed to: ${DEST}" echo "If needed, enable it on the character select screen and type /reload in-game."