summaryrefslogtreecommitdiffstats
path: root/tools/update-license.sh
blob: 870e1735a2975dcef86e5cd472fde988ac83dff5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
# Replaces license text with contents of file provided as an argument
if [ ! $# -eq 1 ]; then
	echo "Usage: $0 [file with new license header]"
	exit 1
fi
find . -name "*.cpp" -or -name "*.h" | while read file; do
	echo $file
	sed '/\/\/ \* This.*/,/If not\, see.*/d' $file > $file.tmp
	cat $1 $file.tmp > $file
	rm $file.tmp
done