diff options
Diffstat (limited to 'checklicense.sh')
-rwxr-xr-x | checklicense.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/checklicense.sh b/checklicense.sh new file mode 100755 index 0000000..587c36c --- /dev/null +++ b/checklicense.sh @@ -0,0 +1,17 @@ +#!/bin/bash -e + +ERROR_COUNT=0 +while read -r file +do + case "$(head -1 "${file}")" in + *"Copyright (c) "*" Alexander Kiryukhin <a.kiryukhin@mail.ru>") + # everything's cool + ;; + *) + echo "$file is missing license header." + (( ERROR_COUNT++ )) + ;; + esac +done < <(git ls-files "*\.go") + +exit $ERROR_COUNT
\ No newline at end of file |