]> gitweb.fluxo.info Git - hydra.git/commitdiff
Handle non-git repositories at sync-media-export
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 4 Nov 2016 13:19:32 +0000 (11:19 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 4 Nov 2016 13:19:32 +0000 (11:19 -0200)
share/hydractl/sync-media-export

index 8647acc1882a0af55c3b11b6899b3bd4e35d98ea..5c5630dd2e96abede941268362101f0859185cfd 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copy git-annex repositories to remote destination.
+# Copy repositories to remote destination.
 #
 
 # Parameters
@@ -30,9 +30,14 @@ for file in `ls $MEDIA`; do
         continue;
       fi
 
-      git clone $file $file.git && \
-      rsync -avz $file.git/ $DESTINATION:/var/cache/media/$file/ && \
-      rm -rf $file.git
+      if [ -d "$file/.git" ]; then
+        git clone $file $file.git && \
+          rsync -avz $file.git/ $DESTINATION:/var/cache/media/$file/ && \
+          rm -rf $file.git
+      else
+        rsync -avz $file/ $DESTINATION:/var/cache/media/$file/
+      fi
+
       echo ""
     else
       mkdir -p $DESTINATION/var/cache/media