Skip to content

Instantly share code, notes, and snippets.

@jonboulle
Created April 13, 2016 14:20
Show Gist options
  • Save jonboulle/73bef2d5c6b6fb4d780cfb5101f03855 to your computer and use it in GitHub Desktop.
Save jonboulle/73bef2d5c6b6fb4d780cfb5101f03855 to your computer and use it in GitHub Desktop.
license header checker thingy
#!/bin/sh
licRes=$(
for file in $(find . -type f -iname '*.go' ! -path './vendor/*'); do
head -n3 "${file}" | grep -Eq "(Copyright|generated|GENERATED)" || echo -e " ${file}"
done;)
if [ -n "${licRes}" ]; then
echo -e "license header checking failed:\n${licRes}"
exit 255
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment