Javicle - a JSON Video Composition Language
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

jvcl_common 1.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. function die () {
  3. echo 1>&2 "${1}"
  4. exit 1
  5. }
  6. function handle_help_request() {
  7. if [[ -z "${2}" ]]; then
  8. return
  9. fi
  10. if [[ ${2} == "-h" || ${2} == "--help" ]]; then
  11. while IFS='' read -r line || [[ -n "$line" ]]; do
  12. if [[ ${line} =~ ^#.* ]]; then
  13. if [[ ! ${line} =~ ^#!/bin/bash.* ]]; then
  14. echo "${line}"
  15. fi
  16. else
  17. break
  18. fi
  19. done <"${1}"
  20. echo "# Environment Variables
  21. #
  22. # JVCL_SCRATCH_DIR : Use this as the scratch directory
  23. # Default is to create a new temp directory
  24. #
  25. # JVCL_NO_EXEC : If set to anything, print the commands that would
  26. # have run but do not execute anything
  27. #
  28. "
  29. exit 1
  30. fi
  31. }
  32. JVCL_DIR="$(cd "$(dirname "${0}")"/.. && pwd)"
  33. JVCL_JAR="$(find "${JVCL_DIR}"/target -type f -name "jvcl-*-prod.jar" | head -1)"
  34. if [[ -z "${JVCL_JAR}" ]] ; then
  35. mvn -DskipTests=true -Puberjar clean package || die "Error building JVCL jar"
  36. JVCL_JAR="$(find "${JVCL_DIR}"/target -type f -name "jvcl-*-prod.jar" | head -1)"
  37. if [[ -z "${JVCL_JAR}" ]] ; then
  38. die "No JVCL jar file found after successful build"
  39. fi
  40. fi
  41. SCRATCH_DIR=""
  42. if [[ -n "${JVCL_SCRATCH_DIR}" ]] ; then
  43. SCRATCH_DIR="--temp-dir ${JVCL_SCRATCH_DIR}"
  44. fi
  45. NO_EXEC=""
  46. if [[ -n "${JVCL_NO_EXEC}" ]] ; then
  47. NO_EXEC="--no-exec"
  48. fi
  49. JVCL_OPTIONS="${SCRATCH_DIR} ${NO_EXEC}"
  50. handle_help_request "${0}" "${1}"