From 9a8bda59e252169a8f1b2fb73ab373582d68e40a Mon Sep 17 00:00:00 2001 From: pruthvidhodda <60198385+pruthvidhodda@users.noreply.github.com> Date: Tue, 3 Mar 2020 14:26:01 -0800 Subject: [PATCH] Modify install script to download release version (#287) --- install/install.ps1 | 2 +- install/install.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install/install.ps1 b/install/install.ps1 index de755ff6..c43f1ad5 100755 --- a/install/install.ps1 +++ b/install/install.ps1 @@ -55,7 +55,7 @@ if ($releases.Count -eq 0) { } # Filter windows binary and download archive -$windowsAsset = $releases[0].assets | where-object { $_.name -Like "*windows_amd64.zip" } +$windowsAsset = $releases | Where-Object { $_.tag_name -notlike "*rc*"} | Select-Object -First 1 | Select-Object -ExpandProperty assets | Where-Object { $_.name -Like "*windows_amd64.zip" } if (!$windowsAsset) { throw "Cannot find the windows Dapr CLI binary" } diff --git a/install/install.sh b/install/install.sh index 13347569..1d7bfc93 100755 --- a/install/install.sh +++ b/install/install.sh @@ -90,9 +90,9 @@ getLatestRelease() { local latest_release="" if [ "$DAPR_HTTP_REQUEST_CLI" == "curl" ]; then - latest_release=$(curl -s $daprReleaseUrl | grep \"tag_name\" | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p') + latest_release=$(curl -s $daprReleaseUrl | grep \"tag_name\" | awk '"![-rc]"' | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p') else - latest_release=$(wget -q --header="Accept: application/json" -O - $daprReleaseUrl | grep \"tag_name\" | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p') + latest_release=$(wget -q --header="Accept: application/json" -O - $daprReleaseUrl | grep \"tag_name\" | awk '"![-rc]"' | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p') fi ret_val=$latest_release