Skip to content

Commit

Permalink
install: use stable tag.
Browse files Browse the repository at this point in the history
Currently we always install onto the latest `master`. Instead,
let's correctly use the latest tag.
  • Loading branch information
MikeMcQuaid committed Mar 14, 2024
1 parent 8494f72 commit 7d8eb69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion install.sh
Expand Up @@ -914,8 +914,14 @@ ohai "Downloading and installing Homebrew..."

execute "${USABLE_GIT}" "fetch" "--force" "origin"
execute "${USABLE_GIT}" "fetch" "--force" "--tags" "origin"
execute "${USABLE_GIT}" "remote" "set-head" "origin" "--auto" >/dev/null

execute "${USABLE_GIT}" "reset" "--hard" "origin/master"
LATEST_GIT_TAG="$("${USABLE_GIT}" tag --list --sort="-version:refname" | head -n1)"
if [[ -z "${LATEST_GIT_TAG}" ]]
then
abort "Failed to query latest Homebrew/brew Git tag."
fi
execute "${USABLE_GIT}" "checkout" "--force" "-B" "stable" "${LATEST_GIT_TAG}"

if [[ "${HOMEBREW_REPOSITORY}" != "${HOMEBREW_PREFIX}" ]]
then
Expand Down

0 comments on commit 7d8eb69

Please sign in to comment.