예제 #1
0
파일: GitProcess.cs 프로젝트: oqewok/gitter
        public static Version CheckVersion(string gitExe)
        {
            var stdErrReceiver = new AsyncTextReader();
            var stdOutReceiver = new AsyncTextReader();
            var executor       = new GitProcessExecutor(gitExe);
            var exitCode       = executor.Execute(new GitInput(new Command("--version")), stdOutReceiver, stdErrReceiver);
            var output         = new GitOutput(stdOutReceiver.GetText(), stdErrReceiver.GetText(), exitCode);

            output.ThrowOnBadReturnCode();
            var parser = new GitParser(output.Output);

            return(parser.ReadVersion());
        }
예제 #2
0
파일: GitProcess.cs 프로젝트: oqewok/gitter
        public static GitOutput Execute(GitInput input)
        {
            Verify.Argument.IsNotNull(input, "input");

            var stdOutReader = new AsyncTextReader();
            var stdErrReader = new AsyncTextReader();
            var executor     = new GitProcessExecutor(GitExePath);
            var exitCode     = executor.Execute(input, stdOutReader, stdErrReader);

            return(new GitOutput(
                       stdOutReader.GetText(),
                       stdErrReader.GetText(),
                       exitCode));
        }