common.bash 362 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. # shellcheck disable=2120
  3. function _panic() {
  4. local message=$1
  5. echo >&2 "$message"
  6. exit 1
  7. }
  8. function _md5() {
  9. local path=$1
  10. md5sum "$path" | cut -d' ' -f1
  11. }
  12. function pushd() {
  13. # shellcheck disable=2119
  14. command pushd "$@" >/dev/null || _panic
  15. }
  16. function popd() {
  17. # shellcheck disable=2119
  18. command popd "$@" >/dev/null || _panic
  19. }