Skip to content

Instantly share code, notes, and snippets.

@lawrence-laz
Created May 8, 2019 19:00
Show Gist options
  • Save lawrence-laz/0ad2a1a04d0546272eba4974cc69f6de to your computer and use it in GitHub Desktop.
Save lawrence-laz/0ad2a1a04d0546272eba4974cc69f6de to your computer and use it in GitHub Desktop.
Tools that opens PowerShell in Unity project's Git root folder.
using System.Diagnostics;
using UnityEditor;
public static class PowerShellOpener
{
[MenuItem("Tools/PowerShell")]
private static void NewMenuOption()
{
var process = new ProcessStartInfo("powershell.exe")
{
WindowStyle = ProcessWindowStyle.Maximized,
Arguments = "-noexit git rev-parse --show-toplevel | cd"
};
Process.Start(process);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment