Commit 1c422eb1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

ginit/gpull/gpush: add support git.somename in the first param

parent 1a85f215
...@@ -12,9 +12,12 @@ if [ "$1" = "-h" ] ; then ...@@ -12,9 +12,12 @@ if [ "$1" = "-h" ] ; then
exit 1 exit 1
fi fi
[ -n "$1" ] && GIRARHOST=$1 if is_girar_name $1 ; then
GIRARHOST=$1
shift
fi
PROJECTNAME=$(basename `pwd`) PROJECTNAME=$(basename `pwd`)
echo "Create remote $PROJECTNAME repo" echo "Create remote $PROJECTNAME repo in $GIRARHOST:"
ssh $GIRARHOST git-init-db $PROJECTNAME.git ssh $GIRARHOST git-init-db $PROJECTNAME.git
git remote add origin $GIRARHOST:packages/$PROJECTNAME.git git remote add origin $GIRARHOST:packages/$PROJECTNAME.git
...@@ -5,8 +5,14 @@ ...@@ -5,8 +5,14 @@
if [ "$1" = "-h" ] ; then if [ "$1" = "-h" ] ; then
echo "gpull [args] - do git pull --rebase" echo "gpull [args] - do git pull --rebase"
echo "Use: ginit without parameters" echo "Use: gpull without parameters"
exit 1 exit 1
fi fi
if is_girar_name $1 ; then
GIRARHOST=$1
shift
fi
echo "Pull repo from $GIRARHOST"
git pull --rebase $@ git pull --rebase $@
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec #test -n "$SPECNAME" || SPECNAME=$(basename `pwd`).spec
if [ "$1" = "-h" ] ; then if [ "$1" = "-h" ] ; then
echo "gpush - publish current project repo to $GIRARHOST" echo "gpush - publish current project repo remote git repo"
echo "Use: gpush [-f|--force] [-a|--all] [project name] [target branch]" echo "Use: gpush [-f|--force] [-a|--all] [project name] [target branch]"
exit 1 exit 1
fi fi
...@@ -23,6 +23,11 @@ if [ "$1" = "-a" ] || [ "$1" = "--all" ] ; then ...@@ -23,6 +23,11 @@ if [ "$1" = "-a" ] || [ "$1" = "--all" ] ; then
shift shift
fi fi
if is_girar_name $1 ; then
GIRARHOST=$1
shift
fi
# use as project name # use as project name
if [ -n "$1" ] ; then if [ -n "$1" ] ; then
PROJECTNAME=$1 PROJECTNAME=$1
...@@ -49,6 +54,7 @@ else ...@@ -49,6 +54,7 @@ else
#[ -n "$PUSHALL" ] || TARGETBRANCH=master #[ -n "$PUSHALL" ] || TARGETBRANCH=master
fi fi
echo "Push $PROJECTNAME.git to $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH"
git push $PUSHALL $PUSHFORCE $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH git push $PUSHALL $PUSHFORCE $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH
git push --tags $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH git push --tags $GIRARHOST:packages/$PROJECTNAME.git $TARGETBRANCH
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment