summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-11-04 11:19:32 -0200
committerSilvio Rhatto <rhatto@riseup.net>2016-11-04 11:19:32 -0200
commit5fda688cf3676d64ee2cfa65902d4523e52c6eeb (patch)
tree87fd13fb7f6028c69367b33368e967f10f29c5f1
parentd3d70fcd08486fbe52e8633113ed0d9c11e5e0c5 (diff)
downloadhydra-5fda688cf3676d64ee2cfa65902d4523e52c6eeb.tar.gz
hydra-5fda688cf3676d64ee2cfa65902d4523e52c6eeb.tar.bz2
Handle non-git repositories at sync-media-export
-rwxr-xr-xshare/hydractl/sync-media-export13
1 files changed, 9 insertions, 4 deletions
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