axify: Use information from git to generate AUTHORS file
authorAlexander Barton <alex@barton.de>
Mon, 1 Sep 2014 22:01:41 +0000 (00:01 +0200)
committerAlexander Barton <alex@barton.de>
Mon, 1 Sep 2014 22:01:41 +0000 (00:01 +0200)
scripts/axify

index ec3d593c84764e3891a572d4aab13199967cbd37..ccd7b8db395d9b685c020d031f4ab3e12bf43e93 100755 (executable)
@@ -64,9 +64,18 @@ fi
 
 # --- Standard project files ---
 
-for f in AUTHORS COPYING README; do
+authors=AUTHORS
+if [ ! -e AUTHORS ]; then
+       if git --version >/dev/null 2>&1; then
+               echo "Creating \"AUTHORS\" file ..."
+               echo "`git config user.name` <`git config user.email`>" >>AUTHORS
+               authors=
+       fi
+fi
+
+for f in $authors COPYING README; do
        if [ ! -e "$f" ]; then
-               echo "Creating empty \"$f\" ..."
+               echo "Creating empty \"$f\" file ..."
                touch "$f"
        fi
 done