是否可以使用Cake脚本克隆Git存储库?如果可以,应该如何操作?
#addin nuget:?package=Cake.Git
Task("Git-Clone")
.Does(() =>
{
GitClone("https://github.com/cake-build/cake.git", "c:/temp/cake");
});
RunTarget("Git-Clone");
#addin nuget:?package=Cake.Git
Task("Git-Clone")
.Does(() =>
{
GitClone("https://github.com/cake-build/cake.git", "c:/temp/cake",
new GitCloneSettings{ BranchName = "main" });
});
RunTarget("Git-Clone");
注意: 这个别名似乎不会创建输出目录。因此,EnsureDirectoryExists别名用于确保它存在。
#addin nuget:?package=Cake.Git
Task("Git-Clone")
.Does(() =>
{
EnsureDirectoryExists("c:/temp/cake");
GitClone("https://github.com/cake-build/cake.git",
"c:/temp/cake",
"username",
"password");
});
RunTarget("Git-Clone");
注意: 这个别名似乎不会创建输出目录。因此,EnsureDirectoryExists 别名被用来确保它存在。
#addin nuget:?package=Cake.Git
Task("Git-Clone")
.Does(() =>
{
EnsureDirectoryExists("c:/temp/cake");
GitClone("https://github.com/cake-build/cake.git",
"c:/temp/cake",
"username",
"password",
new GitCloneSettings{ BranchName = "main" });
});
RunTarget("Git-Clone");