#!/bin/bash
# Installs the plugin so adom-usb discovers it: drops plugin.json + entrypoint
# into ~/.adom/usb-plugins/<slug>/ and puts the entrypoint on PATH.
set -euo pipefail
DIR="$(cd "$(dirname "$0")" && pwd)"; SLUG="adom-usb-sniffer-cdc"
PDIR="${HOME}/.adom/usb-plugins/${SLUG}"; mkdir -p "$PDIR" "${HOME}/.local/bin"
install -m 0644 "$DIR/plugin.json" "$PDIR/plugin.json"
install -m 0755 "$DIR/$SLUG" "$PDIR/$SLUG"
ln -sf "$PDIR/$SLUG" "${HOME}/.local/bin/$SLUG"
echo "Installed plugin -> $PDIR (adom-usb will discover it on next refresh)"