コード例 #1
0
ファイル: Repo.cs プロジェクト: r0flbear/github-manager
        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();
        }
コード例 #2
0
ファイル: Repo.cs プロジェクト: r0flbear/github-manager
        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();
        }