Files
OpenLLM/tools/assert-license-headers
2023-06-08 17:52:39 -04:00

20 lines
359 B
Bash
Executable File

#!/bin/bash
# License header pattern
LICENSE_HEADER=$(
cat << 'EOF'
# Copyright [0-9]{4} BentoML Team. All rights reserved.
EOF
)
# Path to the file being checked
FILE="$1"
# Check if the license header is present in the file
if ! grep -Eq "$LICENSE_HEADER" "$FILE"; then
echo "Make sure to run ./tools/add-license-headers ."
exit 1
fi
exit 0