public void Clone() { Console.WriteLine(RepoName); var ph = new ProcessHelper { Command = "git", Arguments = $"clone [email protected]:{RepoName}.git {HookId}", WorkingDirectory = BasePath }; ph.OnOutput = (sender, e) => { Console.WriteLine("[clone]", e.Data); }; ph.OnError = (sender, e) => { ph.Stop(); throw new Exception("error " + e.Data); }; ph.Start(); }
public void Pull() { var repoPath = $"{BasePath}/{HookId}"; var branch = File.ReadAllText($"{repoPath}/branch.dat"); var ph = new ProcessHelper { Command = "git", Arguments = $"pull origin {branch}", WorkingDirectory = repoPath }; ph.OnError = (sender, e) => { ph.Stop(); throw new Exception("error " + e.Data); }; ph.Start(); }