File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ public static BuildVersion Calculate(GitVersion gitVersion)
2424
2525 if ( ! string . IsNullOrWhiteSpace ( gitVersion . PreReleaseTag ) )
2626 {
27- chocolateyVersion += $ "-{ gitVersion . PreReleaseTag ? . Replace ( "." , "-" ) } ";
27+ // Chocolatey does not support pre-release tags with dots, so we replace them with dashes
28+ // if the pre-release tag is a number, we add a "a" prefix to the pre-release tag
29+ // the trick should be removed when Chocolatey supports semver 2.0
30+ var prefix = int . TryParse ( gitVersion . PreReleaseLabel , out _ ) ? "a" : string . Empty ;
31+ chocolateyVersion += $ "-{ prefix } { gitVersion . PreReleaseTag ? . Replace ( "." , "-" ) } ";
2832 }
2933
3034 if ( ! string . IsNullOrWhiteSpace ( gitVersion . BuildMetaData ) )
You can’t perform that action at this time.
0 commit comments