From f9cdf97b556d29f8bb890bbdcab2d7fc3f82a835 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 8 Nov 2016 16:31:29 -0200 Subject: Minor fixes at sync-media-remotes --- share/hydractl/sync-media-remotes | 9 ++++++--- 1 file 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 -- cgit v1.2.3