public static ExecResult Run(string gitcmd, bool async) { // Pick up git commands that take long time to execute and run them // using a threaded execution if (gitcmd.StartsWith("clone --progress") || gitcmd.StartsWith("fetch") || gitcmd.StartsWith("pull ") || gitcmd.StartsWith("push ")) { FormGitRun formGitRun = new FormGitRun(Properties.Settings.Default.GitPath, gitcmd); formGitRun.ShowDialog(); return(formGitRun.GetResult()); } if (!async) { return(Exec.Run(Properties.Settings.Default.GitPath, gitcmd)); } var job = new Exec(Properties.Settings.Default.GitPath, gitcmd); job.AsyncRun(s => App.PrintStatusMessage(s, MessageType.Output), s => App.PrintStatusMessage(s, MessageType.Error), null); return(new ExecResult()); }
public static ExecResult Run(string gitcmd, bool async) { // Pick up git commands that take long time to execute and run them // using a threaded execution if (gitcmd.StartsWith("clone --progress") || gitcmd.StartsWith("fetch") || gitcmd.StartsWith("pull ") || gitcmd.StartsWith("push ")) { FormGitRun formGitRun = new FormGitRun(Properties.Settings.Default.GitPath, gitcmd); formGitRun.ShowDialog(); return formGitRun.GetResult(); } if (!async) { return Exec.Run(Properties.Settings.Default.GitPath, gitcmd); } var job = new Exec(Properties.Settings.Default.GitPath, gitcmd); job.AsyncRun(s => App.PrintStatusMessage(s, MessageType.Output), s => App.PrintStatusMessage(s, MessageType.Error), null); return new ExecResult(); }