Permalink
Browse files

Update prompt to not fail if git command is missing

  • Loading branch information...
1 parent 78e4f2c commit da37edf8f04796dddcf00cbb6678954f575b7209 @dahlbyk committed Aug 19, 2011
Showing with 6 additions and 1 deletion.
  1. +5 −0 CheckVersion.ps1
  2. +1 −1 GitPrompt.ps1
View
5 CheckVersion.ps1
@@ -1,3 +1,8 @@
+if (!(Get-Command git -TotalCount 1 -ErrorAction SilentlyContinue)) {
+ Write-Warning "git command could not be found. Please create an alias or add it to your PATH."
+ $Global:GitMissing = $true
+ return
+}
$version = git --version 2> $null
if($version -notlike 'git version 1.7.*.msysgit.*') {
Write-Warning "posh-git requires msysgit version 1.7. You have $version."
View
2 GitPrompt.ps1
@@ -40,7 +40,7 @@ $global:GitPromptSettings = New-Object PSObject -Property @{
AutoRefreshIndex = $true
- EnablePromptStatus = $true
+ EnablePromptStatus = !$GitMissing
EnableFileStatus = $true
Debug = $false

0 comments on commit da37edf

Please sign in to comment.