hyperf/bin/split.sh

32 lines
509 B
Bash
Raw Normal View History

2018-12-27 15:11:47 +08:00
#!/usr/bin/env bash
set -e
set -x
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
remote $REPO git@github.com:hyperf/$REPO.git
2019-06-27 17:43:05 +08:00
split "src/$REPO" $REPO
done