mas/script/install
2021-04-28 22:28:29 -07:00

27 lines
598 B
Bash
Executable file

#!/bin/bash -e
#
# script/install
# mas
#
# Installs mas into PREFIX.
#
# NOTE: This script is called by the mas Homebrew formula so it has only system
# dependencies aside from Swift.
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb
#
VERSION=$(script/version)
# Override default prefix path with optional 1st arg
if test -n "$1"; then
PREFIX="$1"
elif [[ $(uname -m) == 'arm64' ]]; then
PREFIX=/opt/homebrew
else
PREFIX=/usr/local
fi
echo "==> 📲 Installing mas ($VERSION) for $ARCH to $PREFIX"
ditto -v \
".build/apple/Products/Release/mas" \
"$PREFIX/bin/"