Skip to content

Commit a9ccf1c

Browse files
smorokinkzu
authored andcommitted
use regex to replace all invalid chars
As suggested by @tobsil
1 parent 9922765 commit a9ccf1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GitInfo/build/GitInfo.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@
571571

572572
<Target Name="GitSetVersion" DependsOnTargets="GitVersion" Condition="'$(GitVersion)' != 'false'">
573573
<PropertyGroup>
574-
<Version>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)+$(GitBranch.Replace('/', '-').Replace('\', '-').Replace('_', '-').$(GitCommit)</Version>
574+
<Version>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)+$([System.Text.RegularExpressions.Regex]::Replace($(GitBranch), "[^0-9A-Za-z-]", "-")).$(GitCommit)</Version>
575575
<PackageVersion>$(Version)</PackageVersion>
576576
</PropertyGroup>
577577
</Target>

0 commit comments

Comments
 (0)