From 30013f2bf5449365b3b66a2a0451516bf1454f6a Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 1 Apr 2015 16:48:58 -0700 Subject: [PATCH] [Licenses] Add script for license headers Add script to add license headers, WTD-1051. --- scripts/licenses.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 scripts/licenses.sh diff --git a/scripts/licenses.sh b/scripts/licenses.sh new file mode 100755 index 0000000000..91b312db8f --- /dev/null +++ b/scripts/licenses.sh @@ -0,0 +1,12 @@ +LICENSE=`cat $3` +MATCHES=`find $1 -name "*.$2" | grep -v /lib/` + +for i in $MATCHES +do + if ! grep -q "$LICENSE" $i + then + cat "$3" "$i" > "$i".new && mv "$i".new "$i" + fi +done + +echo "$LICENSE" \ No newline at end of file