mirror of
https://github.com/mas-cli/mas
synced 2024-12-04 01:09:21 +00:00
e9fcf2b254
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> # Manual Merge Cleanup: # .actrc # .github/workflows/pr-checks.yml # .github/workflows/release.yml # Brewfile # script/test # script/version_bump # Conflicts: # .github/workflows/build-test.yml # .gitignore # .swiftlint.yml # Brewfile.lock.json # Package.resolved # Sources/mas/Package.swift # Tests/masTests/.swiftlint.yml # script/bootstrap # script/build # script/format # script/lint # script/uninstall # script/version
55 lines
1 KiB
Bash
Executable file
55 lines
1 KiB
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]"
|
|
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
|
|
|
|
script/clean
|
|
|
|
printf $'==> 👢 Bootstrapping (%s)\n' "$(script/version)"
|
|
|
|
# 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
|
|
|
|
if [[ ! -x "$(command -v mise)" ]]; then
|
|
brew install mise
|
|
fi
|
|
mise settings set experimental true
|
|
mise install --verbose
|
|
mise list --verbose
|