1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/bash mapfile -t ignore <.licignore ret=0 while read -r -d ''; do if ! grep -q SPDX-License-Identifier "$REPLY"; then ret=1 echo "'$REPLY' has no SPDX-License-Identifier" fi done < <(git ls-files -z "${ignore[@]/#/:!:}") exit "$ret"