2024-09-30 15:28:25 +00:00
|
|
|
#!/bin/bash -eu
|
2019-01-19 04:37:51 +00:00
|
|
|
#
|
|
|
|
# script/bootstrap
|
|
|
|
# mas
|
|
|
|
#
|
2021-03-22 00:42:26 +00:00
|
|
|
# Installs development dependencies and builds project dependencies.
|
2019-01-19 04:37:51 +00:00
|
|
|
#
|
2015-08-21 14:24:33 +00:00
|
|
|
|
2024-09-30 15:28:25 +00:00
|
|
|
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
|
|
|
|
|
2024-03-30 17:03:55 +00:00
|
|
|
function usage {
|
|
|
|
echo "Usage: bootstrap [-f]"
|
|
|
|
echo " -f option enables frozen mode"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
frozen=''
|
|
|
|
|
|
|
|
# Detect presence of `-f` frozen option
|
|
|
|
while getopts "f" opt; do
|
|
|
|
case "${opt}" in
|
|
|
|
f)
|
|
|
|
frozen='-f'
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage 1>&2
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2024-10-15 23:23:13 +00:00
|
|
|
script/clean
|
2020-04-25 20:07:28 +00:00
|
|
|
|
2024-10-15 23:23:13 +00:00
|
|
|
printf $'==> 👢 Bootstrapping (%s)\n' "$(script/version)"
|
2020-04-25 21:19:14 +00:00
|
|
|
|
2024-10-15 23:23:13 +00:00
|
|
|
# Install Homebrew tools
|
2024-10-27 03:48:05 +00:00
|
|
|
if [[ "${frozen}" == "-f" ]]; then
|
|
|
|
# --no-lock Don't touch Brewfile.lock.json
|
|
|
|
brew bundle install --no-lock --no-upgrade --verbose
|
|
|
|
else
|
|
|
|
# Allow upgrades
|
|
|
|
rm -f Brewfile.lock.json
|
|
|
|
brew bundle install --verbose
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -x "$(command -v mise)" ]]; then
|
|
|
|
brew install mise
|
|
|
|
fi
|
|
|
|
mise settings set experimental true
|
|
|
|
mise install --verbose
|
|
|
|
mise list --verbose
|