#!/bin/sh

# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common

#test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec

if [ "$1" = "-h" ] ; then
	echo "ginit [GEAR] - initialize repo in $GIRARHOST for current project"
	echo "Use: ginit without parameters"
	echo "     ginit git.eter - for init in git.eter gear repo"
	exit 1
fi

[ -n "$1" ] && GIRARHOST=$1

PROJECTNAME=$(basename `pwd`)
echo "Create remote $PROJECTNAME repo"
ssh $GIRARHOST git-init-db $PROJECTNAME.git
git remote add origin $GIRARHOST:packages/$PROJECTNAME.git
