mas/script/bootstrap

61 lines
1 KiB
Text
Raw Normal View History

#!/bin/bash -e
#
# script/bootstrap
# mas
#
2021-03-21 17:42:26 -07:00
# Installs development dependencies and builds project dependencies.
#
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
main() {
script/clean
echo "==> 👢 Bootstrapping"
# Install Homebrew tools
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
2024-02-18 13:16:07 -07:00
if [[ ! -x "$(command -v mise)" ]]; then
brew install mise
fi
2024-02-18 14:24:53 -07:00
mise settings set experimental true
mise install --verbose
mise list --verbose
2024-02-18 13:16:07 -07:00
2021-06-08 18:56:27 -07:00
# Already installed on GitHub Actions runner.
if [[ ! -x "$(command -v swiftlint)" ]]; then
brew install swiftlint
fi
2021-04-28 22:56:34 -07:00
# Generate Package.swift
script/version
}
main