mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
removing $result from wrapper string (#13451)
* removing $result from wrapper * test fixes
This commit is contained in:
parent
40bea58c92
commit
4dd1fef558
2 changed files with 1 additions and 3 deletions
|
|
@ -58,8 +58,6 @@ const wrapPowershellString string = `
|
|||
if ($LASTEXITCODE -ne $null -and $LASTEXITCODE -ne 0) {
|
||||
$exitCode = $LASTEXITCODE
|
||||
}
|
||||
|
||||
Write-Host $result
|
||||
exit $exitCode
|
||||
|
||||
`
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ func TestProvisionerPrepare_extractScript(t *testing.T) {
|
|||
|
||||
// File contents should contain 2 lines concatenated by newlines: foo\nbar
|
||||
readFile, err := os.ReadFile(file)
|
||||
expectedContents := " \n\tif (Test-Path variable:global:ProgressPreference) {\n\t set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'\n\t}\n\t\n\t$exitCode = 0\n\ttry {\n\t$env:PACKER_BUILDER_TYPE=\"\"; $env:PACKER_BUILD_NAME=\"\"; \n\tfoo\n\tbar\n\t\n\t$exitCode = 0\n\t} catch {\n\tWrite-Error \"An error occurred: $_\"\n\t$exitCode = 1\n\t}\n\t\n\tif ($LASTEXITCODE -ne $null -and $LASTEXITCODE -ne 0) {\n\t\t$exitCode = $LASTEXITCODE\n\t}\n\t\n\tWrite-Host $result\n\texit $exitCode\n\n"
|
||||
expectedContents := "if (Test-Path variable:global:ProgressPreference) {\n set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'\n }\n \n $exitCode = 0\n try {\n $env:PACKER_BUILDER_TYPE=\"\"; $env:PACKER_BUILD_NAME=\"\"; \n foo\n bar\n \n $exitCode = 0\n } catch {\n Write-Error \"An error occurred: $_\"\n $exitCode = 1\n }\n \n if ($LASTEXITCODE -ne $null -and $LASTEXITCODE -ne 0) {\n $exitCode = $LASTEXITCODE\n }\n exit $exitCode"
|
||||
normalizedExpectedContent := normalizeWhiteSpace(expectedContents)
|
||||
if err != nil {
|
||||
t.Fatalf("Should not be error: %s", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue