From 5a87d49be99c492814d7c843168abe3b07e05daf Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Mon, 8 Jul 2024 15:25:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=89=A7=E8=A1=8C=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/cid.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/handler/cid.go b/handler/cid.go index 84e434d..dfb61cc 100644 --- a/handler/cid.go +++ b/handler/cid.go @@ -68,14 +68,14 @@ func RunCID(c *gin.Context) { //脚本内容,不同用户的持续集成、部署目录不同 scriptContent := ` echo "start" -TARGET_DIR=` + proto.CID_BASE_DIR + username.(string) + `/workspace/` + name + ` +TARGET_DIR=` + proto.CID_BASE_DIR + username.(string) + "/" + name + ` if [ ! -d $TARGET_DIR ]; then git clone ` + cid.Url + ` if [ $? -ne 0 ]; then echo "Failed to clone repository." fi fi -cd "$TARGET_DIR" +cd $TARGET_DIR if [ $? -ne 0 ]; then echo "Failed to change directory to $TARGET_DIR." fi @@ -215,14 +215,14 @@ func CIDCallback(c *gin.Context) { user := dao.FindUserByUserID(res.Auth_id) scriptContent := ` echo "start" -TARGET_DIR=` + proto.CID_BASE_DIR + user.Name + `/workspace/` + name + ` +TARGET_DIR=` + proto.CID_BASE_DIR + user.Name + "/" + name + ` if [ ! -d $TARGET_DIR ]; then - git clone ` + res.Url + ` + git clone ` + res.Url + ` $TARGET_DIR if [ $? -ne 0 ]; then echo "Failed to clone repository." fi fi -cd "$TARGET_DIR" +cd $TARGET_DIR if [ $? -ne 0 ]; then echo "Failed to change directory to $TARGET_DIR." fi