diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-02-20 15:25:40 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-02-20 15:25:40 -0300 |
commit | 70e89b4c42c7deaebf4d848a735ee138775508fe (patch) | |
tree | b75eeeda3f25e82ba292c4db6b2c5bc98ba8a65b /share | |
parent | eaf85de9fad3a21044512a1a739e5356e4c6bf7d (diff) | |
download | hydra-70e89b4c42c7deaebf4d848a735ee138775508fe.tar.gz hydra-70e89b4c42c7deaebf4d848a735ee138775508fe.tar.bz2 |
Init: check if repositories exist
Diffstat (limited to 'share')
-rwxr-xr-x | share/hydra/init | 10 |
1 files changed, 8 insertions, 2 deletions
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 ) |