Skip to content

Commit 44ac066

Browse files
Update GetVersion Script
added fix that was preventing the two digits from the minor version from showing up on releases. Full version values, regardless of number of values will now appear.
1 parent 85b3c18 commit 44ac066

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Scripts/getLatestVersion.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ $file = get-item $propertiesPath
2121
$findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2
2222
$findVersions = $findVersions -split "`r`n"
2323

24-
$majorVersion = $findVersions[0].Substring($findVersions[0].Length-1)
25-
$minorVersion = $findVersions[1].Substring($findVersions[1].Length-1)
26-
$patchVersion = $findVersions[2].Substring($findVersions[2].Length-1)
24+
$versionIndex = $findVersions[0].IndexOf("=")
25+
$majorVersion = $findVersions[0].Substring($versionIndex+2)
26+
$minorVersion = $findVersions[1].Substring($versionIndex+2)
27+
$patchVersion = $findVersions[2].Substring($versionIndex+2)
2728
$version = "$majorVersion.$minorVersion.$patchVersion"
2829

2930
#Update the VERSION_STRING env variable and inform the user
3031
Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
31-
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"
32+
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"

0 commit comments

Comments
 (0)