Merge branch 'master' into project

This commit is contained in:
Chris Araman 2021-03-29 21:51:04 -07:00 committed by GitHub
commit 5321e296f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,13 +18,34 @@ VERSION=$(script/version)
ROOT_URL="https://dl.bintray.com/phatblat/mas-bottles" ROOT_URL="https://dl.bintray.com/phatblat/mas-bottles"
# Supports macOS versions 11.0 (arm64 & x86_64), 10.15, 10.14, 10.13, 10.12, 10.11 # Supports macOS versions 11.0 (arm64 & x86_64), 10.15, 10.14, 10.13, 10.12, 10.11
# NOTE: The built bottle will have the *current* macOS name, which is why the OS_NAMES=(arm64_big_sur big_sur catalina mojave high_sierra sierra el_capitan)
# latest is first in the list (aka ${OS_VERSIONS[0]})
# TODO: Add support for arm64_big_sur # Semantic version number split into a list using Ugly, bash 3 compatible syntax
OS_VERSIONS=(big_sur catalina mojave high_sierra sierra el_capitan) IFS=" " read -r -a CURRENT_OS_VERSION <<<"$(sw_vers -productVersion | sed 's/\./ /g'))"
CURRENT_OS_VERSION_MAJOR=${CURRENT_OS_VERSION[0]}
CURRENT_OS_VERSION_MINOR=${CURRENT_OS_VERSION[1]}
echo "CURRENT_OS_VERSION_MAJOR: $CURRENT_OS_VERSION_MAJOR"
echo "CURRENT_OS_VERSION_MINOR: $CURRENT_OS_VERSION_MINOR"
if [[ ${CURRENT_OS_VERSION_MAJOR} == "11" ]]; then
# Big Sur
if [[ "x86_64" == "$(uname -m)" ]]; then
CURRENT_PLATFORM=big_sur
else
CURRENT_PLATFORM=arm64_big_sur
fi
elif [[ ${CURRENT_OS_VERSION_MAJOR} == "10" && ${CURRENT_OS_VERSION_MINOR} == "15" ]]; then
CURRENT_PLATFORM=catalina
else
echo "Unsupported macOS version. This script requires Catalina or better."
exit 1
fi
echo "CURRENT_PLATFORM: ${CURRENT_PLATFORM}"
# Output filename from build-bottle command # Output filename from build-bottle command
OLD_FILENAME="mas--${VERSION}.${OS_VERSIONS[0]}.bottle.tar.gz" OLD_FILENAME="mas--${VERSION}.${CURRENT_PLATFORM}.bottle.tar.gz"
################################################################################ ################################################################################
# #
@ -36,7 +57,7 @@ brew tap --list-pinned | grep mas-cli/tap && brew tap-unpin mas-cli/tap
# Uninstall if necessary # Uninstall if necessary
if brew ls --versions mas >/dev/null; then if brew ls --versions mas >/dev/null; then
brew uninstall mas brew unlink mas
fi fi
# Uninstall if still found on path # Uninstall if still found on path
@ -54,7 +75,7 @@ rm -rf ~/Library/Caches/org.carthage.CarthageKit
# Build the formula for the current macOS version and architecture. # Build the formula for the current macOS version and architecture.
# #
echo "==> 🍼 Bottling mas ${VERSION} for: ${OS_VERSIONS[*]}" echo "==> 🍼 Bottling mas ${VERSION} for: ${OS_NAMES[*]}"
brew install --build-bottle mas brew install --build-bottle mas
# Generate bottle do block, dropping last 2 lines # Generate bottle do block, dropping last 2 lines
@ -77,7 +98,7 @@ EOF
# #
# Fix filename # Fix filename
for os in ${OS_VERSIONS[*]}; do for os in ${OS_NAMES[*]}; do
new_filename="mas-${VERSION}.${os}.bottle.tar.gz" new_filename="mas-${VERSION}.${os}.bottle.tar.gz"
cp -v "${OLD_FILENAME}" "${BOTTLE_DIR}/${new_filename}" cp -v "${OLD_FILENAME}" "${BOTTLE_DIR}/${new_filename}"