Modify install script to download release version (#287)

This commit is contained in:
pruthvidhodda 2020-03-03 14:26:01 -08:00 committed by GitHub
parent 82520e0df8
commit 9a8bda59e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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"
}

View File

@ -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