#!/usr/bin/env bash # # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # set -e S2N_QUIC_FILES=$(find "$PWD" -type f \( -name "*.rs" -o -name "*.py" \) -not \( -path "*/s2n-quic/target/*" -o -path "*/s2n-tls-sys/s2n/*" \)) FAILED=0 for file in $S2N_QUIC_FILES; do # The word "Copyright" should appear at least once in the first 3 lines of every file COUNT=`head -3 $file | grep "Copyright" | wc -l`; if [ $COUNT == 0 ]; then FAILED=1; echo "Copyright Check Failed: $file"; fi done if [ $FAILED == 1 ]; then printf "\\033[31;1mFAILED Copyright Check\\033[0m\\n" exit -1 else printf "\\033[32;1mPASSED Copyright Check\\033[0m\\n" fi