From a08e1304d4f2a0306e266825759cb78f9ba13e68 Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 4 Jan 2017 14:01:39 -0800 Subject: [PATCH] Windows: gofmt check write out right filename Signed-off-by: John Howard --- hack/make.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hack/make.ps1 b/hack/make.ps1 index 429b5cf297..23f3e5b773 100644 --- a/hack/make.ps1 +++ b/hack/make.ps1 @@ -273,9 +273,10 @@ Function Validate-GoFormat($headCommit, $upstreamCommit) { $outputFile=[System.IO.Path]::GetTempFileName() if (Test-Path $outputFile) { Remove-Item $outputFile } [System.IO.File]::WriteAllText($outputFile, $content, (New-Object System.Text.UTF8Encoding($False))) - $valid=Invoke-Expression "gofmt -s -l $outputFile" - Write-Host "Checking $outputFile" - if ($valid.Length -ne 0) { $badFiles+=$_ } + $currentFile = $_ -Replace("/","\") + Write-Host Checking $currentFile + Invoke-Expression "gofmt -s -l $outputFile" + if ($LASTEXITCODE -ne 0) { $badFiles+=$currentFile } if (Test-Path $outputFile) { Remove-Item $outputFile } } if ($badFiles.Length -eq 0) {