hyperf/bin/split-linux.sh

32 lines
515 B
Bash
Raw Normal View History

2019-06-26 23:30:10 +08:00
#!/usr/bin/env bash
set -e
set -x
2022-11-01 15:33:54 +08:00
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
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
remote $REPO git@github.com:hyperf/$REPO.git
2019-07-16 01:39:53 +08:00
split "src/$REPO" $REPO
done