fmt-check.sh 356 B

123456789101112131415
  1. #!/bin/bash
  2. set -e -o pipefail
  3. OUTPUT=$(goimports -l -d -local github.com/cloudflare/cloudflared $(go list -mod=vendor -f '{{.Dir}}' -a ./... | fgrep -v tunnelrpc))
  4. if [ -n "$OUTPUT" ] ; then
  5. PAGER=$(which colordiff || echo cat)
  6. echo
  7. echo "Code formatting issues found, use 'make fmt' to correct them"
  8. echo
  9. echo "$OUTPUT" | $PAGER
  10. exit 1
  11. fi