github.com/jmccormick2001/sdk-scorecard@v0.8.2/hack/check_license.sh (about) 1 #!/bin/bash 2 3 set -o errexit 4 set -o nounset 5 set -o pipefail 6 7 source "hack/lib/test_lib.sh" 8 9 echo "Checking for license header..." 10 allfiles=$(listFiles) 11 licRes="" 12 for file in $allfiles; do 13 if ! head -n3 "${file}" | grep -Eq "(Copyright|generated|GENERATED)" ; then 14 licRes="${licRes}\n"$(echo -e " ${file}") 15 fi 16 done 17 if [ -n "${licRes}" ]; then 18 echo -e "license header checking failed:\n${licRes}" 19 exit 255 20 fi