Update build script: exit when curl failed

This commit is contained in:
ChsBuffer
2021-04-04 21:39:48 +08:00
parent a3620ed162
commit be9d7d6845
2 changed files with 9 additions and 0 deletions

View File

@@ -24,6 +24,10 @@ param (
.\download.ps1 $OutputPath
if ( -Not $? ) {
Exit 1
}
Write-Host "Building $Configuration to $OutputPath"
dotnet publish `
-c $Configuration `

View File

@@ -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"