From: Silvio Rhatto Date: Fri, 4 Nov 2016 13:19:32 +0000 (-0200) Subject: Handle non-git repositories at sync-media-export X-Git-Tag: 0.2.4~34 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=5fda688cf3676d64ee2cfa65902d4523e52c6eeb;p=hydra.git Handle non-git repositories at sync-media-export --- diff --git a/share/hydractl/sync-media-export b/share/hydractl/sync-media-export index 8647acc..5c5630d 100755 --- a/share/hydractl/sync-media-export +++ b/share/hydractl/sync-media-export @@ -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