Skip to content

Instantly share code, notes, and snippets.

@shaunsales
Created December 1, 2015 05:13
Show Gist options
  • Save shaunsales/0f6c8e778909ac2eb13a to your computer and use it in GitHub Desktop.
Save shaunsales/0f6c8e778909ac2eb13a to your computer and use it in GitHub Desktop.
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