Files
OpenLLM/tools/assert-license-headers
Aaron b7420bf6ce chore: add assert license headers
Current limitation is that it only prints copyright of BentoML team.

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
2023-06-04 16:35:33 -07:00

19 lines
354 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