Git clone fixed
This commit is contained in:
parent
7612457843
commit
c590930d09
8 changed files with 28 additions and 16 deletions
|
|
@ -57,6 +57,7 @@ namespace Yavsc.Migrations
|
|||
migrationBuilder.DropForeignKey(name: "FK_Project_ApplicationUser_ClientId", table: "Project");
|
||||
migrationBuilder.DropForeignKey(name: "FK_Project_PerformerProfile_PerformerId", table: "Project");
|
||||
migrationBuilder.DropForeignKey(name: "FK_ProjectBuildConfiguration_Project_ProjectId", table: "ProjectBuildConfiguration");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GitRepositoryReference",
|
||||
columns: table => new
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ namespace Yavsc.Lib
|
|||
public class GitClone : Batch<Project>
|
||||
{
|
||||
string _repositoryRootPath;
|
||||
string gitPath="git";
|
||||
|
||||
public GitClone(string repoRoot)
|
||||
{
|
||||
|
|
@ -28,10 +29,10 @@ namespace Yavsc.Lib
|
|||
// Model annotations => input.Repository!=null => input.Name == input.Repository.Path
|
||||
var prjPath = Path.Combine(WorkingDir, input.Name);
|
||||
var repoInfo = new DirectoryInfo(prjPath);
|
||||
var gitCmd = repoInfo.Exists ? "pull" : "clone";
|
||||
var gitCmd = repoInfo.Exists ? "pull" : "clone --depth=1";
|
||||
|
||||
var cloneStart = new ProcessStartInfo
|
||||
( gitCmd, $"{gitCmd} {input.Repository.Url} {input.Repository.Path}" )
|
||||
( gitPath, $"{gitCmd} {input.Repository.Url} {input.Repository.Path}" )
|
||||
{
|
||||
WorkingDirectory = WorkingDir,
|
||||
RedirectStandardOutput = true,
|
||||
|
|
@ -52,7 +53,7 @@ namespace Yavsc.Lib
|
|||
writer.WriteLine(process.StandardOutput.ReadLine());
|
||||
}
|
||||
}
|
||||
ResultHandler(true);
|
||||
if (ResultHandler!=null) ResultHandler(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,17 +23,17 @@
|
|||
]
|
||||
},
|
||||
"userSecretsId": "aspnet5-YavscWeb-a0dadd21-2ced-43d3-96f9-7e504345102f",
|
||||
"exclude": [
|
||||
"wwwroot",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"contrib"
|
||||
],
|
||||
"buildOptions": {
|
||||
"debugType": "full",
|
||||
"emitEntryPoint": true,
|
||||
"outputName": "Yavsc",
|
||||
"compile": {
|
||||
"exclude": [
|
||||
"wwwroot",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"contrib"
|
||||
],
|
||||
"include": "*.cs"
|
||||
},
|
||||
"embed": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue