zero-based indexing, not 1-based
parent
c81c8ecba2
commit
d589c3fda9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue