Don't error when removing non-existant env vars

[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
This commit is contained in:
Jason T. Greene 2023-04-04 16:25:04 -05:00
parent ac1d297fc7
commit 80f9f80770
2 changed files with 8 additions and 8 deletions

View File

@ -29,13 +29,13 @@ function DownloadFile {
}
}
# Drop global envs which have unix paths, defaults are fine
Remove-Item Env:\GOPATH
Remove-Item Env:\GOSRC
Remove-Item Env:\GOCACHE
Remove-Item Env:\GOPATH -ErrorAction:Ignore
Remove-Item Env:\GOSRC -ErrorAction:Ignore
Remove-Item Env:\GOCACHE -ErrorAction:Ignore
# Drop large known env variables (an env > 32k will break MSI/ICE validation)
Remove-Item Env:\CIRRUS_COMMIT_MESSAGE
Remove-Item Env:\CIRRUS_PR_BODY
Remove-Item Env:\CIRRUS_COMMIT_MESSAGE -ErrorAction:Ignore
Remove-Item Env:\CIRRUS_PR_BODY -ErrorAction:Ignore
Set-Location contrib\win-installer

View File

@ -10,9 +10,9 @@ function CheckExit {
}
# Drop global envs which have unix paths, defaults are fine
Remove-Item Env:\GOPATH
Remove-Item Env:\GOSRC
Remove-Item Env:\GOCACHE
Remove-Item Env:\GOPATH -ErrorAction:Ignore
Remove-Item Env:\GOSRC -ErrorAction:Ignore
Remove-Item Env:\GOCACHE -ErrorAction:Ignore
mkdir tmp
Set-Location tmp