#!/bin/bash
# adompkg install hook for adom-video-post. Places the prebuilt binary and
# deploys the embedded SKILL.md via the binary's own `install` subcommand.
set -e
HERE="$(cd "$(dirname "$0")" && pwd)"

mkdir -p "$HOME/.local/bin"
cp "$HERE/bin/adom-video-post" "$HOME/.local/bin/adom-video-post"
chmod +x "$HOME/.local/bin/adom-video-post"
# Back-compat `video-post` alias (the short name used in skills + demos).
ln -sf "$HOME/.local/bin/adom-video-post" "$HOME/.local/bin/video-post"
echo "OK: adom-video-post binary at ~/.local/bin/adom-video-post (alias: video-post)"

# Deploy the embedded SKILL.md (idempotent).
"$HOME/.local/bin/adom-video-post" install || true

echo "OK: adom-video-post installed. Run 'adom-video-post health' to verify."