2019-06-26 23:30:10 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2020-05-26 11:33:29 +08:00
|
|
|
CURRENT_BRANCH="2.0"
|
2019-07-16 01:39:53 +08:00
|
|
|
BASEPATH=$(cd `dirname $0`; cd ../src/; pwd)
|
|
|
|
REPOS=$@
|
2019-06-26 23:30:10 +08:00
|
|
|
|
|
|
|
function split()
|
|
|
|
{
|
|
|
|
SHA1=`./bin/splitsh-lite-linux --prefix=$1`
|
|
|
|
git push $2 "$SHA1:refs/heads/$CURRENT_BRANCH" -f
|
|
|
|
}
|
|
|
|
|
|
|
|
function remote()
|
|
|
|
{
|
|
|
|
git remote add $1 $2 || true
|
|
|
|
}
|
|
|
|
|
|
|
|
git pull origin $CURRENT_BRANCH
|
|
|
|
|
2019-07-16 01:39:53 +08:00
|
|
|
if [[ $# -eq 0 ]]; then
|
|
|
|
REPOS=$(ls $BASEPATH)
|
|
|
|
fi
|
2019-06-26 23:30:10 +08:00
|
|
|
|
2019-07-16 01:39:53 +08:00
|
|
|
for REPO in $REPOS ; do
|
2019-10-22 09:35:48 +08:00
|
|
|
remote $REPO git@github.com:hyperf/$REPO.git
|
2019-07-16 01:39:53 +08:00
|
|
|
|
|
|
|
split "src/$REPO" $REPO
|
|
|
|
done
|