From: Silvio Rhatto Date: Mon, 20 Feb 2017 18:25:40 +0000 (-0300) Subject: Init: check if repositories exist X-Git-Tag: 0.2.5~2 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=70e89b4c42c7deaebf4d848a735ee138775508fe;p=hydra.git Init: check if repositories exist --- 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 )