[macOS] Fix output for packer 1.7.1 (#3100)

This commit is contained in:
Mikhail Timofeev
2021-04-05 18:41:57 +03:00
committed by GitHub
parent 0c440c82ca
commit 210e9558ae

View File

@@ -293,7 +293,9 @@ function Get-SVNVersion {
}
function Get-PackerVersion {
$packerVersion = Run-Command "packer --version"
# Packer 1.7.1 has a bug and outputs version to stderr instead of stdout https://github.com/hashicorp/packer/issues/10855
$result = Run-Command -Command "packer --version"
$packerVersion = [regex]::matches($result, "(\d+.){2}\d+").Value
return "Packer $packerVersion"
}