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