proto-script for release note generation
authorMike Rylander <mrylander@gmail.com>
Mon, 1 Apr 2013 17:20:26 +0000 (13:20 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 3 Apr 2013 19:53:44 +0000 (15:53 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
docs/RELEASE_NOTES_NEXT/create_release_notes.sh [new file with mode: 0755]

diff --git a/docs/RELEASE_NOTES_NEXT/create_release_notes.sh b/docs/RELEASE_NOTES_NEXT/create_release_notes.sh
new file mode 100755 (executable)
index 0000000..bb546e8
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+ver=
+while getopts r: opt; do
+  case $opt in
+  r)
+      ver=$OPTARG
+      ;;
+  esac
+done
+
+if [ -z "$ver" ]; then echo "I need a version: -r"; exit; fi
+
+outfile="../RELEASE_NOTES_$ver.txt"
+
+title="Evergreen $ver Release Notes"
+
+echo $title > $outfile;
+for j in `seq 1 ${#title}`; do echo -n '='; done >> $outfile
+
+echo >> $outfile
+echo ':toc:' >> $outfile
+echo ':numbered:' >> $outfile
+echo >> $outfile
+echo Upgrade notes >> $outfile
+echo ------------- >> $outfile
+echo >> $outfile
+
+
+for i in `ls -l|grep ^d|awk '{print $9}'`; do
+    files=$(ls $i/*txt 2>/dev/null)
+    if [ "_$files" != "_" ]; then
+        echo >> $outfile
+        echo >> $outfile
+        echo $i >> $outfile
+        for j in `seq 1 ${#i}`; do echo -n '~'; done >> $outfile
+        echo >> $outfile
+        echo >> $outfile
+
+        for j in $files; do
+            echo >> $outfile
+            echo >> $outfile
+            cat $j >> $outfile
+            echo >> $outfile
+            echo >> $outfile
+        done
+    fi
+done
+
+files=$(ls *txt 2>/dev/null)
+if [ "_$files" != "_" ]; then
+    echo >> $outfile
+    echo Miscellaneous >> $outfile
+    echo ------------- >> $outfile
+    echo >> $outfile
+    for j in $files; do
+        cat $j >> $outfile
+    done
+fi
+