2018-12-27 15:11:47 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2021-06-28 09:36:00 +08:00
|
|
|
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
2019-06-27 17:43:05 +08:00
|
|
|
BASEPATH=$(cd `dirname $0`; cd ../src/; pwd)
|
|
|
|
REPOS=$@
|
2018-12-27 15:11:47 +08:00
|
|
|
|
|
|
|
function split()
|
|
|
|
{
|
|
|
|
SHA1=`./bin/splitsh-lite --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-06-27 17:43:05 +08:00
|
|
|
if [[ $# -eq 0 ]]; then
|
|
|
|
REPOS=$(ls $BASEPATH)
|
|
|
|
fi
|
2018-12-27 15:11:47 +08:00
|
|
|
|
2019-06-27 17:43:05 +08:00
|
|
|
for REPO in $REPOS ; do
|
2019-10-22 09:35:48 +08:00
|
|
|
remote $REPO git@github.com:hyperf/$REPO.git
|
2019-06-27 17:43:05 +08:00
|
|
|
|
|
|
|
split "src/$REPO" $REPO
|
|
|
|
done
|