Skip to content

Commit

Permalink
Fixes beta setup scripts when the latest release is stable
Browse files Browse the repository at this point in the history
  • Loading branch information
waldekmastykarz committed Feb 5, 2025
1 parent 4f64a5c commit 0b17fa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/setup-beta.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ $full_path = Resolve-Path .
if (-not $env:DEV_PROXY_VERSION) {
# Get the latest beta Dev Proxy version
Write-Host "Getting latest beta Dev Proxy version..."
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/dotnet/dev-proxy/releases?per_page=1" -ErrorAction Stop
$version = $response[0].tag_name
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/dotnet/dev-proxy/releases?per_page=2" -ErrorAction Stop
$version = $response | Where-Object { $_.tag_name -like "*-beta*" } | Select-Object -First 1 | Select-Object -ExpandProperty tag_name
Write-Host "Latest beta version is $version"
} else {
$version = $env:DEV_PROXY_VERSION
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup-beta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ set -e # Terminates program immediately if any command below exits with a non-ze
if [ $# -eq 0 ]
then
echo "Getting latest beta Dev Proxy version..."
version=$(curl -s "https://api.github.com/repos/dotnet/dev-proxy/releases?per_page=1" | awk -F: '/"tag_name"/ {print $2}' | sed 's/[", ]//g')
version=$(curl -s "https://api.github.com/repos/dotnet/dev-proxy/releases?per_page=2" | awk -F: '/"tag_name"/ {print $2}' | sed 's/[", ]//g' | grep -m 1 -- "-beta")
echo "Latest beta version is $version"
else
version=$1
Expand Down

0 comments on commit 0b17fa3

Please sign in to comment.