From 6a5f405ba0b0ebe39bf4a1267a4321bd9626627d Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 27 Nov 2014 07:02:54 +0800 Subject: [PATCH] add github script --- trunk/scripts/github.commit.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 trunk/scripts/github.commit.sh diff --git a/trunk/scripts/github.commit.sh b/trunk/scripts/github.commit.sh new file mode 100755 index 000000000..de4b04d2b --- /dev/null +++ b/trunk/scripts/github.commit.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +echo "submit code to github.com" + +echo "argv[0]=$0" +if [[ ! -f $0 ]]; then + echo "directly execute the scripts on shell."; + work_dir=`pwd` +else + echo "execute scripts in file: $0"; + work_dir=`dirname $0`; work_dir=`(cd ${work_dir} && pwd)` +fi +work_dir=`(cd ${work_dir}/.. && pwd)` +product_dir=$work_dir + +# allow start script from any dir +cd $work_dir && git checkout master + +. ${product_dir}/scripts/_log.sh +ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi +ok_msg "导入脚本成功" + +source $work_dir/scripts/_mirror.utils.sh + +git remote -v|grep github.com >/dev/null 2>&1 +ret=$?; if [[ 0 -ne $ret ]]; then + echo "current not under github.com branch" + exit -1; +fi + +sync_push "Github" + +exit 0