#!/usr/bin/env bash
# Goal Power Dialer — one-click updater (macOS / Linux)
set -e
HERE="$(cd "$(dirname "$0")" && pwd)"
TMP=$(mktemp -d)
echo "Downloading latest extension..."
curl -sSL https://app.goalpowerdialer.com/static/extension.zip -o "$TMP/gpd.zip"
echo "Extracting..."
unzip -q -o "$TMP/gpd.zip" -d "$TMP/extracted"
cp -R "$TMP/extracted/power-dialer/." "$HERE/"
rm -rf "$TMP"
echo
echo "==========================================================="
echo " Updated. Open chrome://extensions and click the Reload"
echo " icon on the Goal Power Dialer card."
echo " Then hard-refresh your Impact tab (Cmd+Shift+R)."
echo "==========================================================="
