增加拉取git仓库的方法

This commit is contained in:
白茶清欢 2022-06-27 14:11:14 +08:00
parent e1935738dc
commit c42fac5134

15
git.go
View File

@ -175,3 +175,18 @@ func (g *git) ConfigAuthor(name string, email string) *define.Result {
} }
return nil return nil
} }
// Clone 拉取 git 仓库代码
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 14:03 2022/6/27
func (g *git) Clone(repo string, saveDir string) *define.Result {
param := []string{
repo,
}
if len(saveDir) > 0 {
param = append(param, saveDir)
}
return Execute(g.workDir, g.gitCmdPath, param)
}