File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,18 @@ function BumpSuffix([string] $oldSuffix) {
116
116
117
117
# A suffix is a dash '-', then a sequcence of word characters followed by an optional number
118
118
# Example:
119
- # -alpha => -alpha002
120
- # -alpha1 => -alpha002
119
+ # "" => "-alpha001"
120
+ # "-beta" => "-beta001"
121
+ # "-beta1"=> "-beta002"
121
122
$match = [regex ]::Match($oldSuffix , ' ^-([a-zA-Z]+)(\d+)?$' );
122
123
$oldSuffix = $match.Groups [1 ].Value
124
+ if (! $oldSuffix ) {
125
+ $oldSuffix = " alpha"
126
+ }
127
+
123
128
$numberGroup = $match.Groups [2 ]
124
129
125
- $number = if ($numberGroup.Success ) { 1 + $match.Groups [2 ].Value } else { 2 }
130
+ $number = if ($numberGroup.Success ) { 1 + $match.Groups [2 ].Value } else { 1 }
126
131
127
132
# Use 3 digits for the number "-alpha003", for 999 releases lexically sorted.
128
133
return [string ]::Format(" -{0}{1:D3}" , $oldSuffix , $number )
You can’t perform that action at this time.
0 commit comments