8 Star 16 Fork 0

Gitee 极速下载 / qor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: http://github.com/qor/qor
克隆/下载
update_all_qor_repos.sh 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
jinzhu 提交于 2016-09-20 15:58 . Refactor update all qor repos script
#!/usr/bin/env bash
tmp_dir=$(mktemp -d)
trap "rm -rf $tmp_dir" EXIT
function pull_chances {
local pkg=$(basename $2)
local pkg_path=$1/$2
if [ ! -d "$pkg_path/.git" ]; then
echo "$pkg not a git repo. skipped."
return 0
fi
cd $pkg_path
if [[ `git status -s --untracked-files=no` != "" ]]; then
echo "$pkg is not clean. please stash or commit your changes."
exit 1
fi
git checkout master >> /dev/null 2>&1 || {
echo "failed to update $pkg"
touch $tmp_dir/failed
exit 1
}
(git pull --rebase --quiet && echo -e "\033[31mUpdating $pkg...\033[0m") || {
echo -e "\033[31mfailed to update $pkg\033[0m"
touch $tmp_dir/failed
exit 1
}
}
function update_git_repo {
if [ -d "$1" ]; then
for pkg in $(ls $1); do
pull_chances $1 $pkg &
done
fi
}
update_git_repo $GOPATH/src/github.com/qor
update_git_repo $GOPATH/src/enterprise.getqor.com
wait
if [[ -f "$tmp_dir/failed" ]]; then
echo "failed"
exit 1
else
echo "done"
fi
1
https://gitee.com/mirrors/qor.git
git@gitee.com:mirrors/qor.git
mirrors
qor
qor
master

搜索帮助