Merge branch 'master' of http://git.fredemmott.co.uk/repo/yanihp
[jkt-jerboa.git] / add-copyright-header.sh
blob8d21c92fbfa305e0f24d57e9a921235f624aecba
1 #!/bin/sh
2 NOTICE_HEADER="/* LICENSE NOTICE"
3 TMPFILE=$(mktemp)
4 for file in $(find -name *.cpp -o -name *.h); do
5 if ! grep -q "$NOTICE_HEADER" "$file"; then
6 echo "$NOTICE_HEADER" > $TMPFILE
7 cat COPYING.HEADER >> $TMPFILE
8 echo "*/" >> $TMPFILE
9 cat "$file" >> $TMPFILE
10 cat $TMPFILE > "$file"
12 done
13 rm $TMPFILE