#!/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
