1 Star 0 Fork 12

davidhan008/ros-porting-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
clone-projects-from-gitee.sh 928 Bytes
一键复制 编辑 原始数据 按行查看 历史
NiuTao 提交于 2023-06-08 20:17 . fix: bug fix
#!/bin/bash
. base.sh
GITEE_URL=git@${GITEE_DOAMIN}
GITEE_BASE=${OUTPUT}/gitee
CLONE_BRANCH=humble
prepare()
{
if [ ! -f ${ROS_PROJECTS_NAME} ]
then
error_log "Please give the source repo path of ros"
exit 1
fi
mkdir -p ${GITEE_BASE}
}
main()
{
prepare
info_log "Start to clone projects from $GITEE_URL"
while read project
do
info_log "start clone project ${project}"
if [ -d ${GITEE_BASE}/${project}/.git ]
then
cd ${GITEE_BASE}/${project}
git pull origin ${CLONE_BRANCH}
continue
fi
cd ${GITEE_BASE}
git clone https://${GITEE_DOMAIN}/${GITEE_ORG}/${project}.git
if [ $? -ne 0 ]
then
error_log "fail to clone project ${project}"
continue
fi
cd ${project}
git branch -a | grep ${CLONE_BRANCH}
if [ $? -eq 0 ]
then
git checkout ${CLONE_BRANCH}
else
git checkout -b ${CLONE_BRANCH}
fi
done < ${ROS_PROJECTS_NAME}
info_log "clone project ok"
}
main $*
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/davidhan008/ros-porting-tools.git
[email protected]:davidhan008/ros-porting-tools.git
davidhan008
ros-porting-tools
ros-porting-tools
master

搜索帮助