[macOS] Implement helper to get GitHub package download URL (#4923)

This commit is contained in:
Dibir Magomedsaygitov
2022-02-07 17:19:09 +03:00
committed by GitHub
parent 5217af8068
commit f747f0983b
4 changed files with 36 additions and 15 deletions

View File

@@ -2,8 +2,7 @@
source ~/utils/utils.sh
echo Installing PowerShell...
psRelease=$(curl -H "Authorization: token $API_PAT" -s "https://api.github.com/repos/PowerShell/PowerShell/releases/latest")
psDownloadUrl=$(echo $psRelease | jq -r '.assets[].browser_download_url | select(contains("osx-x64.pkg"))' | head -n 1)
psDownloadUrl=$(get_github_package_download_url "PowerShell" "PowerShell" "contains(\"osx-x64.pkg\")" "latest" "$API_PAT")
download_with_retries $psDownloadUrl "/tmp" "powershell.pkg"
# Work around the issue on macOS Big Sur 11.5 or higher for possible error message ("can't be opened because Apple cannot check it for malicious software") when installing the package