File indexing completed on 2024-10-13 04:14:27

0001 #!/bin/bash
0002 
0003 find "$@" -name '*.h*' -o -name '*.cpp' -o -name '*.qml' -o -name '*.java'| grep -v /3rdparty/ | while read FILE; do
0004     if grep -qiE "SPDX" "$FILE"; then continue; fi
0005     if grep -qiE "Copyright " "$FILE" ; then continue; fi
0006     thisfile=`basename $FILE`
0007     authorName=`git config user.name`
0008     authorEmail=`git config user.email`
0009     thisYear=`date +%Y`
0010     cat <<EOF > "$FILE".tmp
0011 /*
0012     SPDX-FileCopyrightText: $thisYear $authorName <$authorEmail>
0013 
0014     SPDX-License-Identifier: LGPL-2.0-or-later
0015 */
0016 
0017 EOF
0018     cat "$FILE" >> "$FILE".tmp
0019     mv "$FILE".tmp "$FILE"
0020 done