2019-01-03 23:30:33 +00:00
|
|
|
#!/bin/bash -e
|
2018-12-21 04:16:11 +00:00
|
|
|
#
|
|
|
|
# script/install
|
2019-01-19 04:37:51 +00:00
|
|
|
# mas
|
|
|
|
#
|
2021-04-28 21:49:54 +00:00
|
|
|
# Installs mas into PREFIX.
|
2019-01-19 04:37:51 +00:00
|
|
|
#
|
|
|
|
# NOTE: This script is called by the mas Homebrew formula so it has only system
|
2021-04-28 21:49:54 +00:00
|
|
|
# dependencies aside from Swift.
|
2019-01-19 04:37:51 +00:00
|
|
|
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb
|
2018-12-21 04:16:11 +00:00
|
|
|
#
|
2018-10-17 21:43:02 +00:00
|
|
|
|
2021-05-07 18:33:39 +00:00
|
|
|
ARCH=$(uname -m)
|
|
|
|
RELEASE=.build/${ARCH}-apple-macosx/release
|
2023-11-25 23:04:18 +00:00
|
|
|
MAS_VERSION=$(script/version)
|
2023-11-25 23:59:53 +00:00
|
|
|
PREFIX=$(brew --prefix)
|
2018-10-17 22:18:30 +00:00
|
|
|
|
2021-05-07 18:33:39 +00:00
|
|
|
while test -n "$1"; do
|
|
|
|
if [[ "$1" == '--universal' ]]; then
|
|
|
|
ARCH=universal
|
2022-02-04 02:56:53 +00:00
|
|
|
RELEASE=.build/release
|
2021-05-07 18:33:39 +00:00
|
|
|
else
|
|
|
|
# Override default prefix path with optional arg
|
|
|
|
PREFIX="$1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2023-11-25 23:04:18 +00:00
|
|
|
echo "==> 📲 Installing mas ($MAS_VERSION) for $ARCH to $PREFIX"
|
2018-10-17 22:48:35 +00:00
|
|
|
ditto -v \
|
2021-05-07 18:33:39 +00:00
|
|
|
"$RELEASE/mas" \
|
2021-04-28 21:49:54 +00:00
|
|
|
"$PREFIX/bin/"
|