mas/script/bootstrap
Ross Goldberg 36d40d99d7
Simplify & standardize script output headers & mas version handling.
Partial #638

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
2024-11-16 15:49:01 -05:00

37 lines
722 B
Bash
Executable file

#!/bin/bash -eu
#
# script/bootstrap
# mas
#
# Installs development dependencies and builds project dependencies.
#
mas_dir="$(readlink -fn "$(dirname "${BASH_SOURCE:-"${0}"}")/..")"
if ! cd -- "${mas_dir}"; then
printf $'Error: Could not cd into mas directory: %s\n' "${mas_dir}" >&2
exit 1
fi
function usage {
echo 'Usage: bootstrap [-f]' >&2
echo ' -f option enables frozen mode' >&2
exit 1
}
# Detect presence of `-f` frozen option
while getopts 'f' opt; do
case "${opt}" in
f)
frozen='--no-lock --no-upgrade'
;;
*)
usage
;;
esac
done
printf $'==> 👢 Bootstrapping mas %s\n' "$(script/version)"
# shellcheck disable=SC2086
brew bundle install ${frozen} --verbose