deploy.sh 907 B

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