hyperf/bin/split-linux.sh

32 lines
489 B
Bash
Raw Normal View History

2019-06-26 23:30:10 +08:00
#!/usr/bin/env bash
set -e
set -x
2019-08-16 09:56:51 +08:00
CURRENT_BRANCH="master"
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