Fix cloning problem and better debuginfo
This commit is contained in:
parent
61eb27fd08
commit
34254d9ca5
|
@ -59,29 +59,15 @@ namespace SparkleLib {
|
||||||
if (CloningStarted != null)
|
if (CloningStarted != null)
|
||||||
CloningStarted (this, new SparkleEventArgs ("CloningStarted"));
|
CloningStarted (this, new SparkleEventArgs ("CloningStarted"));
|
||||||
|
|
||||||
Process process = new Process () {
|
SparkleGit git = new SparkleGit (SparklePaths.SparkleTmpPath,
|
||||||
EnableRaisingEvents = true
|
"clone \"" + RemoteOriginUrl + "\" " + "\"" + TargetFolder + "\"");
|
||||||
};
|
|
||||||
|
|
||||||
process.StartInfo.RedirectStandardOutput = true;
|
git.Exited += delegate {
|
||||||
process.StartInfo.RedirectStandardError = true;
|
|
||||||
process.StartInfo.UseShellExecute = false;
|
|
||||||
process.StartInfo.FileName = SparklePaths.GitPath;
|
|
||||||
process.StartInfo.Arguments = "clone --progress " +
|
|
||||||
"\"" + RemoteOriginUrl + "\" " + "\"" + TargetFolder + "\"";
|
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Cmd", "git clone --progress " +
|
SparkleHelpers.DebugInfo ("Git", "Exit code " + git.ExitCode.ToString ());
|
||||||
"\"" + RemoteOriginUrl + "\" " + "\"" + TargetFolder + "\"");
|
|
||||||
|
|
||||||
process.Exited += delegate {
|
if (git.ExitCode != 0) {
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Git", "Exit code " + process.ExitCode.ToString ());
|
|
||||||
|
|
||||||
if (process.ExitCode != 0) {
|
|
||||||
|
|
||||||
string error = process.StandardError.ReadToEnd ();
|
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Git", "Error: " + error);
|
|
||||||
SparkleHelpers.DebugInfo ("Git", "[" + TargetFolder + "] Cloning failed");
|
SparkleHelpers.DebugInfo ("Git", "[" + TargetFolder + "] Cloning failed");
|
||||||
|
|
||||||
if (CloningFailed != null)
|
if (CloningFailed != null)
|
||||||
|
@ -101,8 +87,7 @@ namespace SparkleLib {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
process.Start ();
|
git.Start ();
|
||||||
process.WaitForExit ();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,7 @@ namespace SparkleLib {
|
||||||
public SparkleGit (string path, string args) : base ()
|
public SparkleGit (string path, string args) : base ()
|
||||||
{
|
{
|
||||||
|
|
||||||
EnableRaisingEvents = true;
|
EnableRaisingEvents = true;
|
||||||
|
|
||||||
StartInfo.FileName = SparklePaths.GitPath;
|
StartInfo.FileName = SparklePaths.GitPath;
|
||||||
StartInfo.Arguments = args;
|
StartInfo.Arguments = args;
|
||||||
StartInfo.RedirectStandardOutput = true;
|
StartInfo.RedirectStandardOutput = true;
|
||||||
|
@ -34,6 +33,15 @@ namespace SparkleLib {
|
||||||
StartInfo.WorkingDirectory = path;
|
StartInfo.WorkingDirectory = path;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
new public void Start ()
|
||||||
|
{
|
||||||
|
|
||||||
|
SparkleHelpers.DebugInfo ("Cmd", StartInfo.FileName + " " + StartInfo.Arguments);
|
||||||
|
base.Start ();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue