RamblingCookieMonster / PSDepend

PowerShell Dependency Handler
MIT License
282 stars 75 forks source link

Allow Github version tags to match when using a "vX.Y.Z" tag instead of "X.Y.Z" #114

Open mpiederiet opened 4 years ago

mpiederiet commented 4 years ago

Some Github module repos use "vX.Y.Z" tag numbering instead of "X.Y.Z". The following lines in PSDependScripts\Github.ps1 will ensure that the dependency will install (Install-Dependency) and test (Test-Dependency) correctly: (changes in bold, line 354-356) if($GitHubTag.name -match "^v{0,1}\d+(?:.\d+)+$" -and ($DependencyVersion -match "^\d+(?:.\d+)+$" -or $DependencyVersion -eq "latest")) { $GitHubVersion = New-Object "System.Version" ($GitHubTag.name -replace '^v','')

This allows the dependency Version = 'latest' as well as Version = 'x.y.z' to match the mentioned Github tag numbering format.