Files
hyperf-admin/bin/split.sh

31 lines
489 B
Bash
Raw Normal View History

2020-06-17 23:45:36 +08:00
#!/usr/bin/env bash
set -e
set -x
CURRENT_BRANCH="master"
BASEPATH=$(cd `dirname $0`; cd ../src/; pwd)
REPOS=$@
function split()
{
2021-04-21 16:54:21 +08:00
SHA1=`./bin/splitsh-lite --prefix=$1`
2020-06-17 23:45:36 +08:00
git push $2 "$SHA1:refs/heads/$CURRENT_BRANCH" -f
}
function remote()
{
git remote add $1 $2 || true
}
if [[ $# -eq 0 ]]; then
REPOS=$(ls $BASEPATH)
fi
for REPO in $REPOS ; do
remote $REPO git@github.com:hyperf-admin/$REPO.git
split "src/$REPO" $REPO
done
git pull origin $CURRENT_BRANCH