From 29d1378d7afaa7bd8f78bf7cb72e524ef9556fe0 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Tue, 19 May 2015 15:47:06 +0100 Subject: [PATCH] Add git to PATH (while in Cmder) Add bundled git to PATH if we can't find git on PATH. --- vendor/profile.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 7084efd..58c6997 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -11,7 +11,13 @@ if( -not $env:PSModulePath.Contains($CmderModulePath) ){ } try { + # Check if git is on PATH, i.e. Git already installed on system Get-command -Name "git" -ErrorAction Stop >$null +} catch { + $env:Path += ";$env:CMDER_ROOT\vendor\msysgit\bin" +} + +try { Import-Module -Name "posh-git" -ErrorAction Stop >$null $gitStatus = $true } catch {