do.sh 677 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # This script is an interface to any of the methods of lib.sh
  3. # Call this script as "do.sh method_from_lib" to execute any function from that library
  4. set -eu
  5. HERE="$(
  6. cd "$(dirname "${BASH_SOURCE[0]}")"
  7. pwd -P
  8. )"
  9. # shellcheck disable=SC1090
  10. source "${HERE}/lib.sh"
  11. # This guarantees that we're within a venv. A caller that is not within
  12. # a venv can avoid enabling this by setting SENTRY_NO_VENV_CHECK
  13. [ -z "${SENTRY_NO_VENV_CHECK+x}" ] && eval "${HERE}/ensure-venv.sh"
  14. # If you call this script
  15. start=`date +%s`
  16. "$@"
  17. end=`date +%s`
  18. duration=$(($end-$start))
  19. sentry-cli send-metric distribution -n script_execution_time -v $duration -u second -t script:$1