Files
mattermost/scripts/license-check.sh
Joram Wilander 150de584c3 PLT-8131 Bundled zoom plugin (#7947)
* Bundled zoom plugin

* Update plugin to latest
2017-12-05 16:35:46 -05:00

29 lines
776 B
Bash
Executable File

#!/usr/bin/env bash
set -e
IFS=$'\n'
count=0
for fileType in GoFiles; do
for file in `go list -f $'{{range .GoFiles}}{{$.Dir}}/{{.}}\n{{end}}' "$@"`; do
case $file in
*/utils/lru.go|*/store/storetest/mocks/*|*/app/plugin/jira/plugin_*|*/app/plugin/zoom/plugin_*)
# Third-party, doesn't require a header.
;;
*)
if ! grep 'Mattermost, Inc. All Rights Reserved.' $file -q; then
>&2 echo "FAIL: $file is missing a license header."
((count++))
fi
esac
done
done
if [ $count -eq 0 ]; then
exit 0
fi
if [ $count -gt 1 ]; then
>&2 echo "$count files are missing license headers."
else
>&2 echo "$count file is missing a license header."
fi
exit 1