Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update CheckVersion to require Git 1.7.2

  • Loading branch information...
commit aa3fe696a43abeca0056256439694d543fd4d904 1 parent 7d2b95f
@dahlbyk dahlbyk authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 CheckVersion.ps1
View
10 CheckVersion.ps1
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.