From 1d33d02bd37cb38b494991ca0f797dfcaea12e39 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 28 Feb 2014 13:52:52 -0300 Subject: Create BASEDIR / doc update --- share/hydra/init | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'share/hydra/init') 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 -- cgit v1.2.3