fix(cli): clean failed tht installer staging
This commit is contained in:
@@ -122,6 +122,7 @@ try {
|
||||
if ($LASTEXITCODE -ne 0) { throw 'native artifact did not pass its help check' }
|
||||
Replace-InstalledBinary $stagedBinary (Join-Path $installDirectory 'tht.exe')
|
||||
} finally {
|
||||
Remove-Item -LiteralPath $stagedBinary -Force -ErrorAction SilentlyContinue
|
||||
if ($buildOutput) { Remove-Item -LiteralPath $buildOutput -Recurse -Force -ErrorAction SilentlyContinue }
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ public static class ProgramOne {
|
||||
}
|
||||
if (-not $brokenInstallFailed) { throw 'installer accepted an invalid staged executable' }
|
||||
if ((& $installed version) -ne 'tht test version one') { throw 'invalid staged executable replaced the existing command' }
|
||||
$stagingResidue = @(Get-ChildItem -LiteralPath $installDirectory -Filter '.tht-*.exe' -File)
|
||||
if ($stagingResidue.Count -ne 0) { throw 'invalid staged executable left temporary installer files behind' }
|
||||
|
||||
$env:THT_BUILD_ARTIFACT = $artifactTwo
|
||||
$env:THT_BUILD_ARTIFACT_SHA256 = (Get-FileHash -Algorithm SHA256 -LiteralPath $artifactTwo).Hash.ToLowerInvariant()
|
||||
|
||||
Reference in New Issue
Block a user