Browse code

Merge pull request #39879 from thaJeztah/fix_go_version_check_again

hack/ci/windows.ps1: fix Go version check (due to trailing .0)

Tibor Vass authored on 2019/09/12 09:34:45
Showing 2 changed files
... ...
@@ -214,7 +214,8 @@ RUN `
214 214
   Download-File $location C:\gitsetup.zip; `
215 215
   `
216 216
   Write-Host INFO: Downloading go...; `
217
-  Download-File $('https://golang.org/dl/go'+$Env:GO_VERSION.TrimEnd('.0')"+'.windows-amd64.zip') C:\go.zip; `
217
+  $dlGoVersion=$Env:GO_VERSION -replace '\.0$',''; `
218
+  Download-File "https://golang.org/dl/go${dlGoVersion}.windows-amd64.zip" C:\go.zip; `
218 219
   `
219 220
   Write-Host INFO: Downloading compiler 1 of 3...; `
220 221
   Download-File https://raw.githubusercontent.com/jhowardmsft/docker-tdmgcc/master/gcc.zip C:\gcc.zip; `
... ...
@@ -134,7 +134,7 @@ Function Check-InContainer() {
134 134
 # outside of a container where it may be out of date with master.
135 135
 Function Verify-GoVersion() {
136 136
     Try {
137
-        $goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^ARG[\s]+GO_VERSION=(.*)$").Matches.groups[1].Value.TrimEnd(".0")
137
+        $goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^ARG[\s]+GO_VERSION=(.*)$").Matches.groups[1].Value -replace '\.0$',''
138 138
         $goVersionInstalled=(go version).ToString().Split(" ")[2].SubString(2)
139 139
     }
140 140
     Catch [Exception] {