Created
December 1, 2015 05:13
-
-
Save shaunsales/0f6c8e778909ac2eb13a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void WriteGitInfo(string filename, string arguments) | |
{ | |
System.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo(); | |
procStartInfo.FileName = "git"; | |
string path = Application.dataPath.Replace("Assets",""); | |
procStartInfo.WorkingDirectory = path; | |
procStartInfo.Arguments = arguments; | |
procStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized; | |
procStartInfo.CreateNoWindow = true; | |
procStartInfo.RedirectStandardOutput = true; | |
procStartInfo.UseShellExecute = false; | |
System.Diagnostics.Process process = System.Diagnostics.Process.Start(procStartInfo); | |
StreamWriter streamWriter = new StreamWriter(Application.dataPath + "/Resources/" + filename); | |
streamWriter.WriteLine(process.StandardOutput.ReadToEnd()); | |
streamWriter.Flush(); | |
streamWriter.Close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment