run 562 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. # Run scrcpy generated in the specified BUILDDIR.
  3. #
  4. # This provides the same feature as "ninja run", except that it is possible to
  5. # pass arguments to scrcpy.
  6. #
  7. # Syntax: ./run BUILDDIR <scrcpy options ...>
  8. if [[ $# = 0 ]]
  9. then
  10. echo "Syntax: $0 BUILDDIR <scrcpy options>" >&2
  11. exit 1
  12. fi
  13. BUILDDIR="$1"
  14. shift
  15. if [[ ! -d "$BUILDDIR" ]]
  16. then
  17. echo "The build dir \"$BUILDDIR\" does not exist." >&2
  18. exit 1
  19. fi
  20. SCRCPY_ICON_PATH="app/data/icon.png" \
  21. SCRCPY_SERVER_PATH="$BUILDDIR/server/scrcpy-server" \
  22. "$BUILDDIR/app/scrcpy" "$@"