summaryrefslogtreecommitdiff
path: root/share/hydractl/sync-media-remotes
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-11-08 16:31:29 -0200
committerSilvio Rhatto <rhatto@riseup.net>2016-11-08 16:31:29 -0200
commitf9cdf97b556d29f8bb890bbdcab2d7fc3f82a835 (patch)
tree80568177e193412c025900d945823409f537016c /share/hydractl/sync-media-remotes
parent8bb9afefbd3f4ec5aa66383212e856977ec246f5 (diff)
downloadhydra-f9cdf97b556d29f8bb890bbdcab2d7fc3f82a835.tar.gz
hydra-f9cdf97b556d29f8bb890bbdcab2d7fc3f82a835.tar.bz2
Minor fixes at sync-media-remotes
Diffstat (limited to 'share/hydractl/sync-media-remotes')
-rwxr-xr-xshare/hydractl/sync-media-remotes9
1 files changed, 6 insertions, 3 deletions
diff --git a/share/hydractl/sync-media-remotes b/share/hydractl/sync-media-remotes
index 1b8f59e..f3ea062 100755
--- a/share/hydractl/sync-media-remotes
+++ b/share/hydractl/sync-media-remotes
@@ -24,7 +24,7 @@ for folder in `ls $MEDIA`; do
git -C $MEDIA/$folder remote -v | while read remote; do
cd $DEST/$MEDIA/$folder
name="`echo $remote | cut -d ' ' -f 1`"
- addr="`echo $remote | cut -d ' ' -f 2`"
+ addr="`echo $remote | cut -d ' ' -f 2`"
type="`echo $remote | cut -d ' ' -f 3`"
if [ "$type" == "(push)" ]; then
@@ -42,7 +42,7 @@ for folder in `ls $MEDIA`; do
git -C $DEST/$MEDIA/$folder remote -v | while read remote; do
cd $MEDIA/$folder
name="`echo $remote | cut -d ' ' -f 1`"
- addr="`echo $remote | cut -d ' ' -f 2`"
+ addr="`echo $remote | cut -d ' ' -f 2`"
type="`echo $remote | cut -d ' ' -f 3`"
if [ "$type" == "(push)" ]; then
@@ -54,7 +54,10 @@ for folder in `ls $MEDIA`; do
fi
if ! git remote -v | sed -e 's/\t/ /g' | grep -q "^$name $addr $type$"; then
- git -C $DEST/$MEDIA/$folder remote $command $name $arg
+ # Check if was not already removed by a previous command
+ if git -C $DEST/$MEDIA/$folder remote | grep -q "^$name$"; then
+ git -C $DEST/$MEDIA/$folder remote $command $name $arg
+ fi
fi
done
fi