mas/script/install

28 lines
598 B
Text
Raw Normal View History

2019-01-03 15:30:33 -08:00
#!/bin/bash -e
#
# script/install
# mas
#
2021-04-28 14:49:54 -07:00
# Installs mas into PREFIX.
#
# NOTE: This script is called by the mas Homebrew formula so it has only system
2021-04-28 14:49:54 -07:00
# dependencies aside from Swift.
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb
#
VERSION=$(script/version)
2018-10-17 16:48:35 -06:00
# Override default prefix path with optional 1st arg
2018-10-17 16:18:30 -06:00
if test -n "$1"; then
2021-03-21 16:50:09 -07:00
PREFIX="$1"
elif [[ $(uname -m) == 'arm64' ]]; then
2021-03-21 16:50:09 -07:00
PREFIX=/opt/homebrew
else
2021-03-21 16:50:09 -07:00
PREFIX=/usr/local
2018-10-17 16:18:30 -06:00
fi
2021-04-28 14:49:54 -07:00
echo "==> 📲 Installing mas ($VERSION) for $ARCH to $PREFIX"
2018-10-17 16:48:35 -06:00
ditto -v \
2021-04-28 14:49:54 -07:00
".build/apple/Products/Release/mas" \
"$PREFIX/bin/"