shellharden.sh 294 B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. set -eu -o pipefail
  3. DEBUG=${DEBUG:=0}
  4. if [[ "$DEBUG" = "1" ]]; then
  5. set -o xtrace
  6. fi
  7. if ! hash shellharden 2>/dev/null; then
  8. cat <<< "[ERROR] 'shellharden' not found." 1>&2;
  9. exit 78
  10. fi
  11. shellharden --check "$@"
  12. if [[ $? -ne 0 ]]; then
  13. shellharden "$@"
  14. exit 2
  15. fi