Permalink
Browse files

Update CheckVersion to require Git 1.7.2

  • Loading branch information...
dahlbyk committed Aug 26, 2011
1 parent 7d2b95f commit aa3fe696a43abeca0056256439694d543fd4d904
Showing with 7 additions and 3 deletions.
  1. +7 −3 CheckVersion.ps1
View
@@ -3,9 +3,13 @@ if (!(Get-Command git -TotalCount 1 -ErrorAction SilentlyContinue)) {
$Global:GitMissing = $true
return
}
-$version = git --version 2> $null
-if($version -notlike 'git version 1.7.*') {
- Write-Warning "posh-git requires git version 1.7.x You have $version."
+
+$requiredVersion = [Version]'1.7.2'
+if ((git --version 2> $null) -match '(?<ver>\d\.\d\.\d\.\d)') {
+ $version = [Version]$Matches['ver']
+}
+if ($version -lt $requiredVersion) {
+ Write-Warning "posh-git requires Git $requiredVersion or better. You have $version."
$false
} else {
$true

0 comments on commit aa3fe69

Please sign in to comment.