🔈 bottle script output cleanup

This commit is contained in:
Ben Chatelain 2021-03-20 12:11:38 -07:00
parent 7d15707561
commit 8b3ce2efac

View file

@ -57,19 +57,19 @@ fi
# 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_VERSIONS[*]}"
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
brew bottle --verbose --no-rebuild --root-url=$ROOT_URL mas brew bottle --verbose --no-rebuild --root-url=$ROOT_URL mas
SHA256=$(shasum --algorithm 256 "$OLD_FILENAME" | cut -f 1 -d ' ' -) SHA256=$(shasum --algorithm 256 "${OLD_FILENAME}" | cut -f 1 -d ' ' -)
mkdir -p "$BOTTLE_DIR" mkdir -p "$BOTTLE_DIR"
# Start of bottle block # Start of bottle block
BOTTLE_BLOCK=$(cat <<-EOF BOTTLE_BLOCK=$(cat <<-EOF
bottle do bottle do
root_url "$ROOT_URL" root_url "$ROOT_URL"
EOF EOF
) )
@ -81,9 +81,10 @@ EOF
# Fix filename # Fix filename
for os in ${OS_VERSIONS[*]}; do for os in ${OS_VERSIONS[*]}; do
new_filename="mas-${VERSION}.${os}.bottle.tar.gz" new_filename="mas-${VERSION}.${os}.bottle.tar.gz"
cp "$OLD_FILENAME" "$BOTTLE_DIR/$new_filename" cp -v "${OLD_FILENAME}" "${BOTTLE_DIR}/${new_filename}"
# Append each os # Append each os
# BOTTLE_BLOCK="$(printf "${BOTTLE_BLOCK}\n sha256 cellar: :any, %-15s %s" "${os}:" "${SHA256}")"
BOTTLE_BLOCK="$BOTTLE_BLOCK"$(cat <<-EOF BOTTLE_BLOCK="$BOTTLE_BLOCK"$(cat <<-EOF
sha256 cellar: :any, $os: "$SHA256" sha256 cellar: :any, $os: "$SHA256"
@ -92,12 +93,12 @@ EOF
done done
# End of bottle block # End of bottle block
BOTTLE_BLOCK="$BOTTLE_BLOCK"$(cat <<-EOF BOTTLE_BLOCK=$(cat <<-EOF
end end
EOF EOF
) )
rm "$OLD_FILENAME" rm "${OLD_FILENAME}"
ls -l "$BOTTLE_DIR" ls -l "${BOTTLE_DIR}"
echo "$BOTTLE_BLOCK" echo "${BOTTLE_BLOCK}"