[macOS] Refactor the rest of the scripts (#9113)

* [macOS] Refactor the rest of the scripts

* Return quotes to config tccdb script

* Return quotes to config tccdb script

* Revert some changes in ruby scripts

* Revert some changes in ruby scripts

* Revert some changes chrome script

* check errors

* check errors 01

* find errors in common-utils

* find errors in edge install

* find errors in edge install

---------

Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”>
This commit is contained in:
Alexey-Ayupov
2024-01-09 14:47:31 +01:00
committed by GitHub
parent 5bdda2e8c2
commit 5a6e215859
48 changed files with 203 additions and 264 deletions

View File

@@ -11,7 +11,7 @@ arch=$(get_arch)
metadata_json_path=$(download_with_retry "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json")
pwshVersionToolset=$(get_toolset_value '.pwsh.version')
pwshVersions=$(jq -r '.LTSReleaseTag[]' "$metadata_json_path")
pwshVersions=$(jq -r '.LTSReleaseTag[]' $metadata_json_path)
for version in ${pwshVersions[@]}; do
if [[ "$version" =~ "$pwshVersionToolset" ]]; then
@@ -20,19 +20,19 @@ for version in ${pwshVersions[@]}; do
fi
done
pkg_path=$(download_with_retry "$download_url")
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
sudo xattr -rd com.apple.quarantine "$pkg_path"
sudo xattr -rd com.apple.quarantine $pkg_path
sudo installer -pkg "$pkg_path" -target /
sudo installer -pkg $pkg_path -target /
# Install PowerShell modules
psModules=$(get_toolset_value '.powershellModules[].name')
for module in ${psModules[@]}; do
echo "Installing $module module"
moduleVersions="$(get_toolset_value ".powershellModules[] | select(.name==\"$module\") | .versions[]?")"
if [[ -z "$moduleVersions" ]];then
if [[ -z $moduleVersions ]];then
# Check MacOS architecture and sudo on Arm64
if [[ $arch == "arm64" ]]; then
sudo pwsh -command "& {Install-Module $module -Force -Scope AllUsers}"