]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Adding sync_media_identity into sync-media-init
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 18 Apr 2014 15:59:35 +0000 (12:59 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 18 Apr 2014 15:59:35 +0000 (12:59 -0300)
files/sync-media-init

index 2a3f42a8781624824ccbdfb905b18958c4c1e2f0..b32e88c0e058701c343fc23c1fe5273654e38091 100644 (file)
@@ -13,6 +13,15 @@ CACHES=""
 VOLUMES=""
 BOXES=""
 
+# Fix identity
+function sync_media_identity {
+  if [ -z "`git config --local user.email`" ] || [ -z "`git config --local user.name`" ]; then
+    repo="$(basename `pwd`)"
+    git config user.name "${repo^} Asset Manager"
+    git config user.email "$repo@assset.manager"
+  fi
+}
+
 # Syntax check
 if [ -z "$VOLUME" ]; then
   echo "usage: $BASENAME <volume> [<caches|volumes|boxes> [remotes]]"
@@ -45,6 +54,7 @@ for file in `ls $MEDIA`; do
     (
     echo Processing "$MEDIA/$file..."
     cd $MEDIA/$file
+    sync_media_identity
 
     if git remote | grep -q "^origin$"; then
       echo "Removing origin..."