summaryrefslogtreecommitdiff
path: root/share/hydra/init
diff options
context:
space:
mode:
Diffstat (limited to 'share/hydra/init')
-rwxr-xr-xshare/hydra/init10
1 files changed, 8 insertions, 2 deletions
diff --git a/share/hydra/init b/share/hydra/init
index dbc2414..9b817d0 100755
--- a/share/hydra/init
+++ b/share/hydra/init
@@ -31,8 +31,14 @@ if [ -z "$BASEDIR" ]; then
elif grep -q -e "^$HYDRA=" $CONFIG &> /dev/null; then
echo "Hydra $HYDRA already defined"
exit 1
+elif [ -d "$BASEDIR" ]; then
+ echo "Folder $BASEDIR already exists, hydra $HYDRA already defined?"
+ exit 1
fi
+# Create base
+mkdir -p $BASEDIR
+
# Reparse basedir to force absolute folder
BASEDIR="`cd $BASEDIR && pwd`"
@@ -44,8 +50,8 @@ echo "$HYDRA=\"$BASEDIR\"" >> $CONFIG
# Optional remote configuration
if [ ! -z "$REMOTE" ]; then
- echo "Using $REMOTE as private gitolite address."
- echo "PRIVATE_REPOS=$REMOTE" >> $PREFERENCES
+ # Clone configuration repository
+ git clone $REMOTE $BASEDIR/config
else
# No remote was given, so we assume this is a shiny new hydra!
if [ ! -d "$BASEDIR/config" ]; then