File indexing completed on 2024-05-05 03:59:17

0001 #!/bin/bash
0002 
0003 find "$@" -name '*.h' -o -name '*.cpp' -o -name '*.qml' -o -name '*.c' -o -name "*.qdoc" | grep -v /3rdparty/ | grep -v /build | while read FILE; do
0004     if grep -qiE "Copyright \(C\) [0-9, -]{4,} " "$FILE" ; then continue; fi
0005     thisfile=`basename $FILE`
0006     authorName=`git config user.name`
0007     authorEmail=`git config user.email`
0008     thisYear=`date +%Y`
0009     cat <<EOF > "$FILE".tmp
0010 /*
0011     SPDX-FileCopyrightText: $thisYear $authorName <$authorEmail>
0012 
0013     SPDX-License-Identifier: MIT
0014 */
0015 
0016 EOF
0017     cat "$FILE" >> "$FILE".tmp
0018     mv "$FILE".tmp "$FILE"
0019 done
0020