cloudflared-mirror/fmt-check.sh

15 lines
356 B
Bash
Raw Permalink Normal View History

#!/bin/bash
set -e -o pipefail
2022-11-04 23:39:42 +00:00
OUTPUT=$(goimports -l -d -local github.com/cloudflare/cloudflared $(go list -mod=vendor -f '{{.Dir}}' -a ./... | fgrep -v tunnelrpc))
if [ -n "$OUTPUT" ] ; then
PAGER=$(which colordiff || echo cat)
echo
2022-11-04 23:39:42 +00:00
echo "Code formatting issues found, use 'make fmt' to correct them"
echo
echo "$OUTPUT" | $PAGER
exit 1
fi