From f0a499f31e04243b8711dca2c15d13e8483ec2cb Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 29 Apr 2010 11:05:58 +0100 Subject: [PATCH] don't hardcode home dir --- src/SparklePony.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/SparklePony.cs b/src/SparklePony.cs index d0ed2cdb..e5f05784 100644 --- a/src/SparklePony.cs +++ b/src/SparklePony.cs @@ -100,10 +100,8 @@ public class SparklePonyUI { Process.StartInfo.UseShellExecute = false; // Get home folder, example: "/home/user" - Process.StartInfo.FileName = "whoami"; - Process.StartInfo.Arguments = ""; - Process.Start(); - UserHome = "/home/" + Process.StandardOutput.ReadToEnd().Trim () + "/"; + UserHome = Environment.GetEnvironmentVariable("HOME"); + Console.WriteLine (UserHome); // Create 'Collaboration' folder in the user's home folder FoldersPath = UserHome + "/Collaboration"; @@ -539,7 +537,7 @@ public class SparklePonyWindow : Window { Process.StartInfo.RedirectStandardOutput = true; Process.StartInfo.UseShellExecute = false; // TODO: fix hard coding, system independant - Process.StartInfo.WorkingDirectory = "/home/hbons/Collaboration/Deal"; + Process.StartInfo.WorkingDirectory = Environment.GetEnvironmentVariable("HOME") + "/Collaboration/Deal"; Process.StartInfo.FileName = "git"; Process.StartInfo.Arguments = "log --pretty=oneline -20"; Process.Start();