Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }