hack/make.ps1: don't use ENV GO_VERSION

Modify hack/make.ps1 to use the version value used in
"FROM golang" statement.

While at it:
 1. Make search expression a bit more strict (use ^ to match at BOL only).
 2. Simplify by removing Get-Contents as Select-String can read files.

After this, ENV GO_VERSION can be removed from Dockerfile.
Unfortunately it can't be done in one commit as Windows CI
fails (presumably because Dockerfile is being modified in
place).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2018-08-03 13:40:38 +03:00
parent 75fe414440
commit 6a2851332d
1 changed files with 1 additions and 1 deletions

View File

@ -130,7 +130,7 @@ Function Check-InContainer() {
# outside of a container where it may be out of date with master.
Function Verify-GoVersion() {
Try {
$goVersionDockerfile=(Get-Content ".\Dockerfile" | Select-String "ENV GO_VERSION").ToString().Split(" ")[2]
$goVersionDockerfile=(Select-String -Path ".\Dockerfile" -Pattern "^FROM golang:").ToString().Split(" ")[1].SubString(7)
$goVersionInstalled=(go version).ToString().Split(" ")[2].SubString(2)
}
Catch [Exception] {