[mac OS] Set flags for curl invocations (#8008)

This commit is contained in:
Vasilii Polikarpov
2023-08-01 15:42:44 +02:00
committed by GitHub
parent 67f9c37eee
commit 463cbf01cf
14 changed files with 18 additions and 18 deletions

View File

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

View File

@@ -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')"

View File

@@ -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=()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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