diff --git a/images/macos/provision/configuration/configure-machine.sh b/images/macos/provision/configuration/configure-machine.sh index 2e80198d0..9b268a80a 100644 --- a/images/macos/provision/configuration/configure-machine.sh +++ b/images/macos/provision/configuration/configure-machine.sh @@ -47,7 +47,7 @@ certs=( for cert in ${certs[@]}; do echo "Adding ${cert} certificate" cert_path="${HOME}/${cert}" - curl "https://www.apple.com/certificateauthority/${cert}" --output ${cert_path} --silent + curl -fsSL "https://www.apple.com/certificateauthority/${cert}" --output ${cert_path} sudo ./add-certificate ${cert_path} diff --git a/images/macos/provision/core/codeql-bundle.sh b/images/macos/provision/core/codeql-bundle.sh index dab0f9dc0..abce292e5 100644 --- a/images/macos/provision/core/codeql-bundle.sh +++ b/images/macos/provision/core/codeql-bundle.sh @@ -2,7 +2,7 @@ source ~/utils/utils.sh # Retrieve the CLI versions and bundle tags of the latest two CodeQL bundles. -base_url="$(curl -sSL https://raw.githubusercontent.com/github/codeql-action/v2/src/defaults.json)" +base_url="$(curl -fsSL https://raw.githubusercontent.com/github/codeql-action/v2/src/defaults.json)" codeql_tag_name="$(echo "$base_url" | jq -r '.bundleVersion')" codeql_cli_version="$(echo "$base_url" | jq -r '.cliVersion')" prior_codeql_tag_name="$(echo "$base_url" | jq -r '.priorBundleVersion')" diff --git a/images/macos/provision/core/dotnet.sh b/images/macos/provision/core/dotnet.sh index eb877600d..8e86c5642 100755 --- a/images/macos/provision/core/dotnet.sh +++ b/images/macos/provision/core/dotnet.sh @@ -14,7 +14,7 @@ arch=$(get_arch) # Download installer from dot.net and keep it locally DOTNET_INSTALL_SCRIPT="https://dot.net/v1/dotnet-install.sh" -curl -L -o "dotnet-install.sh" "$DOTNET_INSTALL_SCRIPT" +curl -fsSL -o "dotnet-install.sh" "$DOTNET_INSTALL_SCRIPT" chmod +x ./dotnet-install.sh ARGS_LIST=() diff --git a/images/macos/provision/core/edge.sh b/images/macos/provision/core/edge.sh index 388c6dbf5..25ff3ffb4 100644 --- a/images/macos/provision/core/edge.sh +++ b/images/macos/provision/core/edge.sh @@ -13,7 +13,7 @@ echo "Version of Microsoft Edge: ${EDGE_VERSION}" echo "Installing Microsoft Edge WebDriver..." EDGE_DRIVER_VERSION_URL="https://msedgedriver.azureedge.net/LATEST_RELEASE_${EDGE_VERSION_MAJOR}_MACOS" -EDGE_DRIVER_LATEST_VERSION=$(curl -s "$EDGE_DRIVER_VERSION_URL" | iconv -f utf-16 -t utf-8 | tr -d '\r') +EDGE_DRIVER_LATEST_VERSION=$(curl -fsSL "$EDGE_DRIVER_VERSION_URL" | iconv -f utf-16 -t utf-8 | tr -d '\r') EDGE_DRIVER_URL="https://msedgedriver.azureedge.net/${EDGE_DRIVER_LATEST_VERSION}/edgedriver_mac64.zip" echo "Compatible version of WebDriver: ${EDGE_DRIVER_LATEST_VERSION}" diff --git a/images/macos/provision/core/haskell.sh b/images/macos/provision/core/haskell.sh index 342c5f6ec..93aaf14bc 100644 --- a/images/macos/provision/core/haskell.sh +++ b/images/macos/provision/core/haskell.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -o pipefail -curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh +curl --proto '=https' --tlsv1.2 -fsSL https://get-ghcup.haskell.org | sh export PATH="$HOME/.ghcup/bin:$PATH" echo 'export PATH="$PATH:$HOME/.ghcup/bin"' >> "$HOME/.bashrc" diff --git a/images/macos/provision/core/miniconda.sh b/images/macos/provision/core/miniconda.sh index 1032afdf8..acbbacb85 100644 --- a/images/macos/provision/core/miniconda.sh +++ b/images/macos/provision/core/miniconda.sh @@ -1,7 +1,7 @@ #!/bin/bash -e -o pipefail MINICONDA_INSTALLER="/tmp/miniconda.sh" -curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o $MINICONDA_INSTALLER +curl -fsSL https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o $MINICONDA_INSTALLER chmod +x $MINICONDA_INSTALLER sudo $MINICONDA_INSTALLER -b -p /usr/local/miniconda diff --git a/images/macos/provision/core/node.sh b/images/macos/provision/core/node.sh index ae6145861..4407f1c62 100644 --- a/images/macos/provision/core/node.sh +++ b/images/macos/provision/core/node.sh @@ -8,7 +8,7 @@ brew_smart_install "node@$defaultVersion" brew link node@$defaultVersion --force --overwrite echo Installing yarn... -curl -o- -L https://yarnpkg.com/install.sh | bash +curl -fsSL https://yarnpkg.com/install.sh | bash npm_global_packages=$(get_toolset_value '.npm.global_packages[].name') for module in ${npm_global_packages[@]}; do diff --git a/images/macos/provision/core/nvm.sh b/images/macos/provision/core/nvm.sh index 098861139..7d30908ba 100755 --- a/images/macos/provision/core/nvm.sh +++ b/images/macos/provision/core/nvm.sh @@ -6,8 +6,8 @@ source ~/utils/utils.sh [ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}") -VERSION=$(curl "${authString[@]}" -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name') -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash +VERSION=$(curl "${authString[@]}" -fsSL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name') +curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash if [ $? -eq 0 ]; then . ~/.bashrc diff --git a/images/macos/provision/core/openjdk.sh b/images/macos/provision/core/openjdk.sh index 831115436..8f6dec9ec 100755 --- a/images/macos/provision/core/openjdk.sh +++ b/images/macos/provision/core/openjdk.sh @@ -23,9 +23,9 @@ installOpenJDK() { # Get link for Java binaries and Java version if [[ ${VENDOR_NAME} == "Temurin-Hotspot" ]]; then - assetUrl=$(curl -s "https://api.adoptium.net/v3/assets/latest/${JAVA_VERSION}/hotspot") + assetUrl=$(curl -fsSL "https://api.adoptium.net/v3/assets/latest/${JAVA_VERSION}/hotspot") elif [[ ${VENDOR_NAME} == "Adopt" ]]; then - assetUrl=$(curl -s "https://api.adoptopenjdk.net/v3/assets/latest/${JAVA_VERSION}/hotspot") + assetUrl=$(curl -fsSL "https://api.adoptopenjdk.net/v3/assets/latest/${JAVA_VERSION}/hotspot") else echo "${VENDOR_NAME} is invalid, valid names are: Temurin-Hotspot and Adopt" exit 1 diff --git a/images/macos/provision/core/powershell.sh b/images/macos/provision/core/powershell.sh index 424909f2c..d503fb4d7 100644 --- a/images/macos/provision/core/powershell.sh +++ b/images/macos/provision/core/powershell.sh @@ -4,7 +4,7 @@ source ~/utils/utils.sh echo Installing PowerShell... arch=$(get_arch) -psmetadata=$(curl "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json" -s) +psmetadata=$(curl -fsSL "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json") psver=$(echo $psmetadata | jq -r '.LTSReleaseTag[0]') psDownloadUrl=$(get_github_package_download_url "PowerShell/PowerShell" "contains(\"osx-$arch.pkg\")" "$psver" "$API_PAT") download_with_retries $psDownloadUrl "/tmp" "powershell.pkg" diff --git a/images/macos/provision/core/pypy.sh b/images/macos/provision/core/pypy.sh index 95d060a62..d9f0707c3 100644 --- a/images/macos/provision/core/pypy.sh +++ b/images/macos/provision/core/pypy.sh @@ -76,7 +76,7 @@ function InstallPyPy } arch=$(get_arch) -pypyVersions=$(curl https://downloads.python.org/pypy/versions.json) +pypyVersions=$(curl -fsSL https://downloads.python.org/pypy/versions.json) toolsetVersions=$(get_toolset_value '.toolcache[] | select(.name | contains("PyPy")) | .arch.'$arch'.versions[]') for toolsetVersion in $toolsetVersions; do diff --git a/images/macos/provision/core/ruby.sh b/images/macos/provision/core/ruby.sh index 104e4c95d..e931b2c9a 100755 --- a/images/macos/provision/core/ruby.sh +++ b/images/macos/provision/core/ruby.sh @@ -22,7 +22,7 @@ fi if ! is_VenturaArm64; then echo "Install Ruby from toolset..." [ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}") - PACKAGE_TAR_NAMES=$(curl "${authString[@]}" -s "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name') + PACKAGE_TAR_NAMES=$(curl "${authString[@]}" -fsSL "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name') TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .arch.'$arch'.versions[]') RUBY_PATH="$AGENT_TOOLSDIRECTORY/Ruby" diff --git a/images/macos/provision/core/vsmac.sh b/images/macos/provision/core/vsmac.sh index dfcb37ba9..7e4cbc4ee 100644 --- a/images/macos/provision/core/vsmac.sh +++ b/images/macos/provision/core/vsmac.sh @@ -6,11 +6,11 @@ install_vsmac() { local VSMAC_VERSION=$1 local VSMAC_DEFAULT=$2 if [ $VSMAC_VERSION == "2019" ]; then - VSMAC_DOWNLOAD_URL=$(curl -sL "https://aka.ms/manifest/stable" | jq -r '.items[] | select(.genericName=="VisualStudioMac").url') + VSMAC_DOWNLOAD_URL=$(curl -fsSL "https://aka.ms/manifest/stable" | jq -r '.items[] | select(.genericName=="VisualStudioMac").url') elif [ $VSMAC_VERSION == "2022" ]; then - VSMAC_DOWNLOAD_URL=$(curl -sL "https://aka.ms/manifest/stable-2022" | jq -r '.items[] | select(.genericName=="VisualStudioMac").url') + VSMAC_DOWNLOAD_URL=$(curl -fsSL "https://aka.ms/manifest/stable-2022" | jq -r '.items[] | select(.genericName=="VisualStudioMac").url') elif [ $VSMAC_VERSION == "preview" ]; then - VSMAC_DOWNLOAD_URL=$(curl -sL "https://aka.ms/manifest/preview" | jq -r '.items[] | select(.genericName=="VisualStudioMac").url') + VSMAC_DOWNLOAD_URL=$(curl -fsSL "https://aka.ms/manifest/preview" | jq -r '.items[] | select(.genericName=="VisualStudioMac").url') else VSMAC_DOWNLOAD_URL=$(buildVSMacDownloadUrl $VSMAC_VERSION) fi diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index 125c1761c..eb8dd76d1 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -202,7 +202,7 @@ get_github_package_download_url() { [ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}") - json=$(curl "${authString[@]}" -sSf "https://api.github.com/repos/${REPO_ORG}/releases?per_page=${SEARCH_IN_COUNT}") + json=$(curl "${authString[@]}" -fsSL "https://api.github.com/repos/${REPO_ORG}/releases?per_page=${SEARCH_IN_COUNT}") if [[ "$VERSION" == "latest" ]]; then tagName=$(echo $json | jq -r '.[] | select((.prerelease==false) and (.assets | length > 0)).tag_name' | sort --unique --version-sort | egrep -v ".*-[a-z]" | tail -1)