This commit is contained in:
leo 2021-08-04 19:21:27 +08:00
parent 78bb68b82e
commit 8894705321
2 changed files with 17 additions and 4 deletions

View file

@ -110,7 +110,13 @@ namespace SourceGit.Commands {
errs.Add(e.Data);
};
try {
proc.Start();
} catch (Exception e) {
if (!DontRaiseError) Models.Exception.Raise(e.Message);
return false;
}
proc.BeginOutputReadLine();
proc.BeginErrorReadLine();
proc.WaitForExit();
@ -143,7 +149,15 @@ namespace SourceGit.Commands {
if (!string.IsNullOrEmpty(Cwd)) start.WorkingDirectory = Cwd;
var proc = new Process() { StartInfo = start };
try {
proc.Start();
} catch (Exception e) {
return new ReadToEndResult() {
Output = "",
Error = e.Message,
IsSuccess = false,
};
}
var rs = new ReadToEndResult();
rs.Output = proc.StandardOutput.ReadToEnd();

View file

@ -4,8 +4,7 @@ namespace SourceGit.Commands {
/// </summary>
public class Config : Command {
public Config() {
}
public Config() {}
public Config(string repo) {
Cwd = repo;