Files
concrete/.github/workflows/scripts/check_for_license.sh
2022-01-03 15:27:24 +01:00

27 lines
898 B
Bash
Executable File

#!/bin/bash
print_and_exit() {
echo "Need to add license header to file $1"
exit 1
}
files=$(find ./compiler/{include,lib,src} -iregex '^.*\.\(cpp\|cc\|h\|hpp\)$')
for file in $files
do
cmp <(head -n 4 $file) <(echo "// Part of the Concrete Compiler Project, under the BSD3 License with Zama
// Exceptions. See
// https://github.com/zama-ai/homomorphizer/blob/master/LICENSE.txt for license
// information.") || print_and_exit $file
done
# Ignore python package namespace init file
files=$(find ./compiler/{include,lib,src} -iregex '^.*\.\(py\)$' ! -path ./compiler/lib/Bindings/Python/concrete/__init__.py)
for file in $files
do
cmp <(head -n 2 $file) <(echo "# Part of the Concrete Compiler Project, under the BSD3 License with Zama Exceptions.
# See https://github.com/zama-ai/homomorphizer/blob/master/LICENSE.txt for license information.") || print_and_exit $file
done