diff --git a/src/.nuget/BuildRyuJitPackage.ps1 b/src/.nuget/BuildRyuJitPackage.ps1 index 767eca4172cb..8f66df80e607 100644 --- a/src/.nuget/BuildRyuJitPackage.ps1 +++ b/src/.nuget/BuildRyuJitPackage.ps1 @@ -59,9 +59,23 @@ function Get-Latest-Blob-Name return $chosenBlob } +# Set the CWD +[System.Environment]::CurrentDirectory = Get-Location + # Get the list of blobs in storage -$json = (azure storage blob list -a $storageAccount -k $storageKey $storageContainer --json) -join "" -$blobs = ConvertFrom-Json $json +$json = "" +$blobs = @() +try +{ + $json = (azure storage blob list -a $storageAccount -k $storageKey $storageContainer --json) -join "" + $blobs = ConvertFrom-Json $json +} +catch +{ + Write-Error "Could not fetch blobs from Azure." + Write-Error "Response: $json" + exit 1 +} # Find, fetch, and extract the latest Ubuntu and OSX blobs [System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null @@ -84,7 +98,7 @@ if (!$osxBlob) azure storage blob download -m -q -a $storageAccount -k $storageKey $storageContainer $ubuntuBlob if ($LastExitCode -ne 0) { - Write-Error "Failed to fetch Ubuntu drop $ubuntuDrop from Azure." + Write-Error "Failed to fetch Ubuntu drop $ubuntuBlob from Azure." exit 1 } @@ -149,7 +163,7 @@ $packages = @( # Note: nuget appears to exit with code 0 in every case, so there's no way to detect failure here # other than looking at the output. foreach ($package in $packages) { - Invoke-Expression "$nugetPath pack $packageOutputDir\$package.nuspec -NoPackageAnalysis -NoDefaultExludes -OutputDirectory $packageOutputDir" + Invoke-Expression "$nugetPath pack $packageOutputDir\$package.nuspec -NoPackageAnalysis -NoDefaultExcludes -OutputDirectory $packageOutputDir" Invoke-Expression "$nugetPath push -NonInteractive $packageOutputDir\$package.nupkg -s $feed $apiKey" }