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