Simplify script/bootstrap.

We shouldn't need to delete `Brewfile.lock.json` because it doesn't actually lock anything; it just records versions that were installed.

If we don't delete it, new `brew bundle install` run just adds info about what was installed during its run to the existing info about previous bundle installs.

By not deleting, the code can be simplified as per this commit.

Partial #638

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
Ross Goldberg 2024-11-15 16:23:25 -05:00
parent 67ca8f5404
commit b4e42b5dd6
No known key found for this signature in database

View file

@ -19,13 +19,11 @@ function usage {
exit 1 exit 1
} }
frozen=''
# Detect presence of `-f` frozen option # Detect presence of `-f` frozen option
while getopts "f" opt; do while getopts "f" opt; do
case "${opt}" in case "${opt}" in
f) f)
frozen='-f' frozen='--no-lock --no-upgrade'
;; ;;
*) *)
usage 1>&2 usage 1>&2
@ -35,15 +33,8 @@ done
printf $'==> 👢 Bootstrapping (%s)\n' "$(script/version)" printf $'==> 👢 Bootstrapping (%s)\n' "$(script/version)"
# Install Homebrew tools # shellcheck disable=SC2086
if [[ "${frozen}" == "-f" ]]; then brew bundle install ${frozen} --verbose
# --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
mise settings set experimental true mise settings set experimental true
mise install --verbose mise install --verbose