From be9d7d6845af84a72c8ec109a91d878727055f08 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sun, 4 Apr 2021 21:39:48 +0800 Subject: [PATCH] Update build script: exit when curl failed --- build.ps1 | 4 ++++ download.ps1 | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/build.ps1 b/build.ps1 index 8ef8d990..42541be8 100644 --- a/build.ps1 +++ b/build.ps1 @@ -24,6 +24,10 @@ param ( .\download.ps1 $OutputPath +if ( -Not $? ) { + Exit 1 +} + Write-Host "Building $Configuration to $OutputPath" dotnet publish ` -c $Configuration ` diff --git a/download.ps1 b/download.ps1 index 39afedb1..5375136a 100644 --- a/download.ps1 +++ b/download.ps1 @@ -46,6 +46,11 @@ function DownloadAndExtract { $TargetPath ) $json = Invoke-RestMethod "https://api.github.com/repos/$Owner/$Repo/git/refs/$ref" + + if ( -Not $? ) { + Exit 1; + } + $sha = $json.object.sha $archiveUrl = "https://github.com/$Owner/$Repo/archive/$sha.zip"