Created
February 13, 2012 23:47
-
-
Save motowilliams/1821540 to your computer and use it in GitHub Desktop.
Test craplet to look at closing solution, change branch, open solution
This file contains hidden or 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
using System; | |
using EnvDTE; | |
namespace VSBouncer | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var command = args[0]; | |
var solutionPath = args[1]; | |
DTE dte = (DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.10.0"); | |
var solution = dte.Solution; | |
var fullPath = System.IO.Path.GetFullPath(solutionPath); | |
if (command.Equals("open", StringComparison.OrdinalIgnoreCase)) | |
solution.Open(fullPath); | |
if (command.Equals("close", StringComparison.OrdinalIgnoreCase)) | |
solution.Close(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to get a way to keep branch chaning from sucking w/ VS and git. Just messing around and calling this craplet before and after some very hard-coded command line goo worked. I though it might be a good pre-checkout git hook but that doens't exist. Then thought maybe a posh-git interceptor or something. Maybe it just needs to be a hi-jacked git alias?