From be02a33c723a1711ddf08cee32986c203050422a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 6 Aug 2020 14:05:43 +0800 Subject: [PATCH] better error handling when publishing module (#7131) --- .../src/main/resources/powershell/appveyor.mustache | 4 +--- samples/client/petstore/powershell/appveyor.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache b/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache index 0f70eb14ecf..b3ecb9cf594 100644 --- a/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/appveyor.mustache @@ -18,12 +18,10 @@ deploy_script: - ps: | if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null -and $env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") { .\Build.ps1 - choco install NuGet.CommandLine - Install-PackageProvider -Name NuGet -Force Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\src\{{{packageName}}}\ -Confirm:$False -Verbose if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) - exit $LastExitCode + exit } else { Write-Host "Published the PowerShell module." } diff --git a/samples/client/petstore/powershell/appveyor.yml b/samples/client/petstore/powershell/appveyor.yml index 1d3959705c8..8e6678129af 100644 --- a/samples/client/petstore/powershell/appveyor.yml +++ b/samples/client/petstore/powershell/appveyor.yml @@ -24,12 +24,10 @@ deploy_script: - ps: | if ($env:APPVEYOR_REPO_TAG -eq $true -and $env:NuGetApiKey -ne $null -and $env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") { .\Build.ps1 - choco install NuGet.CommandLine - Install-PackageProvider -Name NuGet -Force Publish-Module -NuGetApiKey $env:NuGetApiKey -Path .\src\PSPetstore\ -Confirm:$False -Verbose if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) - exit $LastExitCode + exit } else { Write-Host "Published the PowerShell module." }