#!/usr/bin/env bash set -u usage() { printf 'Usage: %s install|uninstall|reload all|namlv2|lsp|dragonfly-reverb|pipewire|mod-host|reconcile|midi-bridge\n' "$0" >&2 exit 2 } [[ $# -eq 2 ]] || usage action=$1 target=$2 case "$action" in install|uninstall|reload) ;; *) usage ;; esac case "$target" in all) targets=(pipewire namlv2 lsp dragonfly-reverb) ;; namlv2|lsp|dragonfly-reverb|pipewire|mod-host|reconcile|midi-bridge) targets=("$target") ;; *) usage ;; esac script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) status=0 for component in "${targets[@]}"; do printf '%s\n' "== $action $component ==" if ! python3 "$script_dir/deploy.py" "$action" "$component"; then status=1 fi done exit "$status"