mac: set the --exec-path when calling the bundled git

This commit is contained in:
Hylke Bons 2012-01-22 17:17:36 +00:00
parent 07527618af
commit 43f2129236
2 changed files with 18 additions and 5 deletions

View file

@ -16,26 +16,34 @@
using System;
using System.IO;
using System.Diagnostics;
namespace SparkleLib {
public class SparkleGit : Process {
public static string ExecPath = null;
public SparkleGit (string path, string args) : base ()
{
EnableRaisingEvents = true;
StartInfo.FileName = SparkleBackend.DefaultBackend.Path;
StartInfo.Arguments = args;
StartInfo.RedirectStandardOutput = true;
StartInfo.UseShellExecute = false;
StartInfo.WorkingDirectory = path;
if (!string.IsNullOrEmpty (ExecPath))
StartInfo.Arguments = "--exec-path=\"" + ExecPath + "\" " + args;
else
StartInfo.Arguments = args;
}
new public void Start ()
{
SparkleHelpers.DebugInfo ("Cmd", StartInfo.FileName + " " + StartInfo.Arguments);
SparkleHelpers.DebugInfo ("Cmd", "git " + StartInfo.Arguments);
base.Start ();
}
}

View file

@ -42,20 +42,25 @@ namespace SparkleShare {
public SparkleController () : base ()
{
string content_path =
Directory.GetParent (System.AppDomain.CurrentDomain.BaseDirectory)
.ToString ();
Directory.GetParent (System.AppDomain.CurrentDomain.BaseDirectory).ToString ();
string app_path = Directory.GetParent (content_path).ToString ();
string growl_path = Path.Combine (app_path, "Frameworks", "Growl.framework", "Growl");
// Needed for Growl
Dlfcn.dlopen (growl_path, 0);
NSApplication.Init ();
// Let's use the bundled git first
SparkleBackend.DefaultBackend.Path =
Path.Combine (NSBundle.MainBundle.ResourcePath,
"git", "bin", "git");
"git", "libexec", "git-core", "git");
SparkleGit.ExecPath =
Path.Combine (NSBundle.MainBundle.ResourcePath,
"git", "libexec", "git-core");
}