deploy.sh 781 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. set -u
  3. usage() {
  4. printf 'Usage: %s install|uninstall|reload all|namlv2|lsp|dragonfly-reverb|pipewire|mod-host|reconcile|midi-bridge|sooperlooper\n' "$0" >&2
  5. exit 2
  6. }
  7. [[ $# -eq 2 ]] || usage
  8. action=$1
  9. target=$2
  10. case "$action" in
  11. install|uninstall|reload) ;;
  12. *) usage ;;
  13. esac
  14. case "$target" in
  15. all) targets=(pipewire namlv2 lsp dragonfly-reverb) ;;
  16. namlv2|lsp|dragonfly-reverb|pipewire|mod-host|reconcile|midi-bridge|sooperlooper) targets=("$target") ;;
  17. *) usage ;;
  18. esac
  19. script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
  20. status=0
  21. for component in "${targets[@]}"; do
  22. printf '%s\n' "== $action $component =="
  23. if ! python3 "$script_dir/deploy.py" "$action" "$component"; then
  24. status=1
  25. fi
  26. done
  27. exit "$status"