Preserve updater exit code in bootstrap
This commit is contained in:
@@ -62,7 +62,10 @@ exit `$LASTEXITCODE
|
||||
"@
|
||||
|
||||
& powershell.exe -NoProfile -ExecutionPolicy Bypass -Command $command
|
||||
return $LASTEXITCODE
|
||||
$exitCode = $LASTEXITCODE
|
||||
if ($exitCode -ne 0) {
|
||||
throw "OCSentinel updater exited with code $exitCode"
|
||||
}
|
||||
}
|
||||
|
||||
Initialize-OCSentinelTls
|
||||
@@ -104,10 +107,7 @@ function Assert-ArtifactSignature {
|
||||
|
||||
if (Test-Path -LiteralPath $updaterPath) {
|
||||
Write-Host "Existing OCSentinel installation found. Checking for updates."
|
||||
$updaterExitCode = Invoke-OCSentinelUpdater -UpdaterPath $updaterPath -ManifestUri $ManifestUrl
|
||||
if ($updaterExitCode -ne 0) {
|
||||
throw "OCSentinel updater exited with code $updaterExitCode"
|
||||
}
|
||||
Invoke-OCSentinelUpdater -UpdaterPath $updaterPath -ManifestUri $ManifestUrl
|
||||
}
|
||||
else {
|
||||
Write-Host "Reading OCSentinel release manifest: $ManifestUrl"
|
||||
|
||||
Reference in New Issue
Block a user