Created
April 27, 2012 20:33
-
-
Save Restuta/2512835 to your computer and use it in GitHub Desktop.
Adds GitExtensions support to the git bash
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
| $os=Get-WMIObject win32_operatingsystem | |
| if ($os.OSArchitecture -eq "64-bit") { | |
| $gitInstallationDir = "c:\Program Files (x86)\Git\" | |
| } | |
| else { | |
| $gitInstallationDir = "c:\Program Files\Git\" | |
| } | |
| #adding git installation directory to PATH variable | |
| if (-not $env:Path.Contains($gitInstallationDir)) { | |
| Write-Host "Adding git installation path to system PATH..." -ForegroundColor DarkYellow | |
| $env:Path = $env:Path + ";" + $gitInstallationDir | |
| } | |
| #creating "git-ex" file in "git/bin" folder | |
| $gitExFilePath = $gitInstallationDir + "bin/git-ex" | |
| if (-not (Test-Path $gitExFilePath)) { | |
| #file content start | |
| $gitExFileContent = "#!/bin/sh | |
| ""`$PROGRAMFILES\GitExtensions\GitExtensions.exe"" ""$@"" &" | |
| #file content end | |
| New-Item $gitExFilePath -type: file -value $gitExFileContent | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment