aboutsummaryrefslogtreecommitdiff
path: root/share/hydra/init
diff options
context:
space:
mode:
Diffstat (limited to 'share/hydra/init')
-rwxr-xr-xshare/hydra/init15
1 files changed, 12 insertions, 3 deletions
diff --git a/share/hydra/init b/share/hydra/init
index 4a6d0c1..a69e885 100755
--- a/share/hydra/init
+++ b/share/hydra/init
@@ -38,20 +38,29 @@ fi
# Clone configuration repository or setup a new hydra
if [ ! -z "$REMOTE" ]; then
- git clone $REMOTE $BASEDIR
+ mkdir -p $BASEDIR
+
+ # Try to clone the superproject first
+ git clone $REMOTE $BASEDIR 2> /dev/null
(
cd $BASEDIR
# Initialize only the required repositories
for repo in $BASEREPOS; do
- git submodule update --init $repo
+ if [ -e '.gitmodules' ] && grep -q \"config\" .gitmodules; then
+ git submodule update --init $repo
+ else
+ git clone ${REMOTE}$repo `basename $repo .git`
+ fi
done
)
else
# Create the superproject
mkdir -p $BASEDIR
- hydra_git_init $BASEDIR
+
+ # Optional: version control in the superproject
+ #hydra_git_init $BASEDIR
# Create config repository
if [ ! -d "$BASEDIR/config" ]; then