fix some path issues

This commit is contained in:
Hylke Bons 2010-04-29 12:05:55 +01:00
parent 177d47c896
commit 4565aa2ba9

View file

@ -207,9 +207,9 @@ public class Repository {
Process.StartInfo.RedirectStandardOutput = true; Process.StartInfo.RedirectStandardOutput = true;
Process.StartInfo.UseShellExecute = false; Process.StartInfo.UseShellExecute = false;
// Get user.name, example: "/home/user/Collaboration/" // Get the repository's path, example: "/home/user/Collaboration/repo"
RepoPath = Path; RepoPath = Path;
Process.StartInfo.WorkingDirectory = RepoPath; Process.StartInfo.WorkingDirectory = RepoPath + "/";
// Get user.name, example: "User Name" // Get user.name, example: "User Name"
UserName = "Anonymous"; UserName = "Anonymous";
@ -232,7 +232,7 @@ public class Repository {
RemoteOriginUrl = Process.StandardOutput.ReadToEnd().Trim (); RemoteOriginUrl = Process.StandardOutput.ReadToEnd().Trim ();
// Get the repository name, example: "project" // Get the repository name, example: "project"
Name = RepoPath.Substring (RepoPath.LastIndexOf ("/") + 1); Name = RepoPath.Substring (RepoPath.TrimEnd ( "/".ToCharArray ()).LastIndexOf ("/") + 1);
// Get the domain, example: "github.com" // Get the domain, example: "github.com"
Domain = RemoteOriginUrl; Domain = RemoteOriginUrl;
@ -305,7 +305,7 @@ public class Repository {
Process.Start(); Process.Start();
// Add a gitignore file // Add a gitignore file
TextWriter Writer = new StreamWriter(RepoPath + "/.gitignore"); TextWriter Writer = new StreamWriter(RepoPath + ".gitignore");
Writer.WriteLine("*~"); Writer.WriteLine("*~");
Writer.Close(); Writer.Close();
} }