deploy.sh 849 B

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