From 37ad4a6581d5bf8d5206d0f494064a7e3d9bee74 Mon Sep 17 00:00:00 2001 From: silverqx Date: Fri, 22 Dec 2023 18:18:48 +0100 Subject: [PATCH] tools enhanced Get-VcpkgHash --- tools/Get-VcpkgHash.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/Get-VcpkgHash.ps1 b/tools/Get-VcpkgHash.ps1 index 3064a5da1..cc698e00d 100644 --- a/tools/Get-VcpkgHash.ps1 +++ b/tools/Get-VcpkgHash.ps1 @@ -52,8 +52,6 @@ Param( Set-StrictMode -Version 3.0 -. $PSScriptRoot\private\Common-Host.ps1 - # Get a git object by the current parameter set # The vcpkg uses the archive/ prefix only without the refs/heads/ or refs/tags/: # https://github.com/microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_github.cmake#L107 @@ -96,8 +94,9 @@ try { vcpkg hash $tempFile } catch { - # Exiting directly from the catch block is ok, the finally block will be invoked correctly - Write-ExitError "Failed to download the archive for hashing from the URL:`n$url" + Write-Error "Failed to download the archive for hashing from the URL:`n$url" + # Re-throw + throw } finally { $ProgressPreference = $previousProgressPreference