From f332364a4465fda75d2485b1b9d4f3ac45325561 Mon Sep 17 00:00:00 2001 From: t-moe Date: Sun, 10 May 2015 14:15:28 +0200 Subject: [PATCH] Added scripts to update/create file headers --- genheader.sh | 15 +++++++++++++++ updateheaders.sh | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 genheader.sh create mode 100755 updateheaders.sh diff --git a/genheader.sh b/genheader.sh new file mode 100755 index 0000000..7be2999 --- /dev/null +++ b/genheader.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +echo "/**************************************************************************************************************************************" +echo "* Project: discoverpixy" +echo "* Authors: Aaron Schmocker, Timo Lang" +echo "* Institution: BFH Bern University of Applied Sciences" +echo "* File: $1" +echo "*" +echo "* Version History:" +echo "* Date Autor Email SHA Changes" + +git log --pretty=format:"* %ad%x09%ae%x09%h%x09%s" --date=short --date-order --no-merges --reverse $1 | grep -v -i "fileheader" + +echo "*" +echo "**************************************************************************************************************************************/" diff --git a/updateheaders.sh b/updateheaders.sh new file mode 100755 index 0000000..84068bb --- /dev/null +++ b/updateheaders.sh @@ -0,0 +1,19 @@ +#!/bin/bash + + +FILES=`find common/ emulator/ discovery/ -name "*.c" -or -name "*.h" -or -name "*.cpp" | grep -v libs | grep -v /pixy/` + +for FILE in $FILES; do + echo "Adding Header to $FILE" + + #remove old header + CONTENT=$(perl -0777 -pe 's%^/\*.*?discoverpixy.*?\*/%%igs' $FILE) + + #add new header + ./genheader.sh $FILE > $FILE + + #append file content + echo "$CONTENT" >> $FILE + +done +