File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- Function Get-GitTagList {
1+ Function Get-GitTagList {
22 <#
33 . SYNOPSIS
44 Gets a normalized list of Git Tags of the current Git Repo
@@ -9,15 +9,18 @@ Function Get-GitTagList {
99 Get-GitTagList
1010 #>
1111 Param (
12+ [string ]
1213 $TagPrefix
1314 ,
14- [switch ] $Latest
15+ [switch ]
16+ $Latest
1517 ,
16- [switch ] $GitVersionContiniousDeploymentMode
18+ [switch ]
19+ $GitVersionContiniousDeploymentMode
1720 )
1821
1922 $gittagdata = git for - each- ref -- sort= taggerdate -- format= ' %(if)%(*objectname)%(then)%(*objectname)%(else)%(objectname)%(end)##%(refname)##%(taggerdate:iso)' refs/ tags
20- If ($TagPrefix ) {
23+ If ($TagPrefix -notin $null , ' ' ) {
2124 $gittagdata = $gittagdata | Where-Object { $_ -match " refs/tags/$TagPrefix -" }
2225 }
2326 $taglist = @ ()
@@ -30,7 +33,7 @@ Function Get-GitTagList {
3033
3134 $tagParts = $tagvalue -Split ' -'
3235 ForEach ($tagPart in $tagParts ) {
33- If ($TagPrefix -and $tagPart -eq $TagPrefix ) { continue }
36+ If ($TagPrefix -notin $null , ' ' - and $tagPart -eq $TagPrefix ) { continue }
3437 $tagPart = $tagPart.Replace (' v' , ' ' )
3538 Try {
3639 # Tags needs to be a valid SemVerId
You can’t perform that action at this time.
0 commit comments