Add better error handling in Prepare-Release (#2233)

Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
This commit is contained in:
Azure SDK Bot 2021-05-07 23:34:45 -04:00 committed by GitHub
parent 2b169ca777
commit 5e6d4be92c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -136,6 +136,11 @@ if ($null -eq $newVersionParsed)
-packageType $packageProperties.SDKType `
-packageNewLibrary $packageProperties.IsNewSDK
if ($LASTEXITCODE -ne 0) {
Write-Error "Updating of the Devops Release WorkItem failed."
exit 1
}
if ($releaseTrackingOnly)
{
Write-Host

View File

@ -19,11 +19,17 @@ param(
Set-StrictMode -Version 3
if (!(Get-Command az -ErrorAction SilentlyContinue)) {
Write-Host 'You must have the Azure CLI installed: https://aka.ms/azure-cli'
Write-Error 'You must have the Azure CLI installed: https://aka.ms/azure-cli'
exit 1
}
az extension show -n azure-devops > $null
az account show *> $null
if (!$?) {
Write-Host 'Running az login...'
az login *> $null
}
az extension show -n azure-devops *> $null
if (!$?){
Write-Host 'Installing azure-devops extension'
az extension add --name azure-devops