Skip to content

Commit

Permalink
Fixed Remote Repo Parameter
Browse files Browse the repository at this point in the history
updatet Readme
  • Loading branch information
Christian Werner committed Jun 22, 2012
1 parent 2cb3b46 commit 9a0d3bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Accepts a remote repo name as parameter
if you would like to push to another repo

OPTIONS:
-o will overwrite the post commit hook
-o will overwrite the post commit hook
-r [repo] Remote Repo to push to
14 changes: 7 additions & 7 deletions git-autopush.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
usage()
{
cat << EOF
usage $0 [<options>] [<remoterepo>]
usage $0 [<options>] [-r <remoterepo>]
will add a post-commit function in the git repo
which will automaticly push to the default or remote repo
OPTIONS:
-o Overwrite post-commit
-r Remote Repo
EOF
}
params="$@"

OVERWRITE=0

while getopts "ho" OPTION
while getopts "hor:" OPTION
do
case $OPTION in
h)
Expand All @@ -26,14 +27,13 @@ do
o)
OVERWRITE=1
;;
?)
usage
exit
r)
REMOTEREPO="$OPTARG"
;;
esac
done

shift $(( $OPTIND - 1 ))

HOOKS_FOLDER=.git/hooks
POST_COMMIT=$HOOKS_FOLDER/post-commit

Expand Down

0 comments on commit 9a0d3bb

Please sign in to comment.