[macOS] pin pwsh-core in toolset (#9070)

This commit is contained in:
Mikhail Koliada
2023-12-27 16:00:04 +01:00
committed by GitHub
parent 62a46d0fd8
commit 62aeae3a20
5 changed files with 22 additions and 2 deletions

View File

@@ -10,8 +10,16 @@ echo Installing PowerShell...
arch=$(get_arch)
metadata_json_path=$(download_with_retry "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json")
version=$(jq -r '.LTSReleaseTag[0]' "$metadata_json_path")
download_url=$(resolve_github_release_asset_url "PowerShell/PowerShell" "contains(\"osx-$arch.pkg\")" "$version" "$API_PAT")
pwshVersionToolset=$(get_toolset_value '.pwsh.version')
pwshVersions=$(jq -r '.LTSReleaseTag[]' "$metadata_json_path")
for version in ${pwshVersions[@]}; do
if [[ "$version" =~ "$pwshVersionToolset" ]]; then
download_url=$(resolve_github_release_asset_url "PowerShell/PowerShell" "contains(\"osx-$arch.pkg\")" "$version" "$API_PAT")
break
fi
done
pkg_path=$(download_with_retry "$download_url")
# 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