From 70e89b4c42c7deaebf4d848a735ee138775508fe Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 20 Feb 2017 15:25:40 -0300 Subject: Init: check if repositories exist --- share/hydra/init | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/hydra/init b/share/hydra/init index 0c33ad3..2caf1c5 100755 --- a/share/hydra/init +++ b/share/hydra/init @@ -39,7 +39,9 @@ fi # Clone configuration repository or setup a new hydra if [ ! -z "$REMOTE" ]; then # Try to clone the superproject first - git clone $REMOTE $BASEDIR 2> /dev/null + if git ls-remote $REMOTE &> /dev/null; then + git clone $REMOTE $BASEDIR + fi ( mkdir -p $BASEDIR @@ -50,7 +52,11 @@ if [ ! -z "$REMOTE" ]; then if [ -e '.gitmodules' ] && grep -q \"config\" .gitmodules; then git submodule update --init $repo else - git clone ${REMOTE}/$repo `basename $repo .git` + if git ls-remote ${REMOTE}/$repo &> /dev/null; then + git clone ${REMOTE}/$repo `basename $repo .git` + else + echo "Skipping unavailable ${REMOTE}/$repo..." + fi fi done ) -- cgit v1.2.3