From d589c3fda9a334835a44446fe2117811ae163b23 Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Fri, 16 Apr 2021 13:23:52 -0400 Subject: [PATCH] zero-based indexing, not 1-based --- .../bin/executable_clone-all-gitea-repos.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/private_dot_local/bin/executable_clone-all-gitea-repos.sh b/private_dot_local/bin/executable_clone-all-gitea-repos.sh index f1dd965..eab33bc 100644 --- a/private_dot_local/bin/executable_clone-all-gitea-repos.sh +++ b/private_dot_local/bin/executable_clone-all-gitea-repos.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash -set -x GITEA_HOST=${GITEA_HOST:-$1} if [ -z "$GITEA_HOST" ] || [ -z "$GITEA_ACCESS_TOKEN" ] ; then @@ -26,11 +25,11 @@ for i in $(curl -s --header "Authorization: token $GITEA_ACCESS_TOKEN" "${GITEA_ fi fi else - if [ -d "${fields[1]}" ] ; then - echo "Repo ${fields[1]} already exists, skipping." + if [ -d "${fields[0]}" ] ; then + echo "Repo ${fields[0]} already exists, skipping." else - echo "Cloning ${fields[1]} from ${fields[2]}" - git clone -q "${fields[2]}" + echo "Cloning ${fields[0]} from ${fields[1]}" + git clone -q "${fields[1]}" fi fi done