GitCommands.GitModule.StartProccess C# (CSharp) Method

StartProccess() private static method

private static StartProccess ( string fileName, string arguments, string workingDir, bool showConsole ) : Process
fileName string
arguments string
workingDir string
showConsole bool
return Process
        private static Process StartProccess(string fileName, string arguments, string workingDir, bool showConsole)
        {
            GitCommandHelpers.SetEnvironmentVariable();

            string quotedCmd = fileName;
            if (quotedCmd.IndexOf(' ') != -1)
                quotedCmd = quotedCmd.Quote();

            var executionStartTimestamp = DateTime.Now;

            var startInfo = new ProcessStartInfo
                                {
                                    FileName = fileName,
                                    Arguments = arguments,
                                    WorkingDirectory = workingDir
                                };
            if (!showConsole)
            {
                startInfo.UseShellExecute = false;
                startInfo.CreateNoWindow = true;
            }

            var startProcess = Process.Start(startInfo);

            startProcess.Exited += (sender, args) =>
            {
                var executionEndTimestamp = DateTime.Now;
                AppSettings.GitLog.Log(quotedCmd + " " + arguments, executionStartTimestamp, executionEndTimestamp);
            };

            return startProcess;
        }
GitModule