github.com/fretkak/mattermost-mattermost-server@v5.11.1+incompatible/scripts/license-check.sh (about) 1 #!/usr/bin/env bash 2 set -e 3 IFS=$'\n' 4 count=0 5 for fileType in GoFiles; do 6 for file in `go list -f $'{{range .GoFiles}}{{$.Dir}}/{{.}}\n{{end}}' "$@"`; do 7 case $file in 8 */utils/lru.go|*/utils/imgutils/gif.go|*/store/storetest/mocks/*|*/services/*/mocks/*|*/app/plugin/jira/plugin_*|*/plugin/plugintest/*|*/app/plugin/zoom/plugin_*) 9 # Third-party, doesn't require a header. 10 ;; 11 *) 12 if ! grep 'Mattermost, Inc. All Rights Reserved.' $file -q; then 13 >&2 echo "FAIL: $file is missing a license header." 14 ((count++)) 15 fi 16 esac 17 done 18 done 19 if [ $count -eq 0 ]; then 20 exit 0 21 fi 22 23 if [ $count -gt 1 ]; then 24 >&2 echo "$count files are missing license headers." 25 else 26 >&2 echo "$count file is missing a license header." 27 fi 28 exit 1