Only set bash variables once.

Partial #638

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
Ross Goldberg 2024-11-16 02:43:50 -05:00
parent 8338d0b5de
commit 602131df1d
No known key found for this signature in database

View file

@ -14,18 +14,20 @@ if ! cd -- "${mas_dir}"; then
fi fi
# Build for the host architecture by default. # Build for the host architecture by default.
ARCH=()
if [[ "${#}" -ge 1 && "${1}" == '--universal' ]]; then if [[ "${#}" -ge 1 && "${1}" == '--universal' ]]; then
ARCH=( ARCH=(
--arch arm64 --arch arm64
--arch x86_64 --arch x86_64
) )
else
ARCH=()
fi fi
# Disable the manifest cache. # Disable the manifest cache.
CACHE=()
if [[ "$(swift build --help)" =~ manifest-cache ]]; then if [[ "$(swift build --help)" =~ manifest-cache ]]; then
CACHE=(--manifest-cache none) CACHE=(--manifest-cache none)
else
CACHE=()
fi fi
echo "==> 🏗️ Building mas ($(script/version --write))" echo "==> 🏗️ Building mas ($(script/version --write))"