Skip to content

Commit

Permalink
Fix brew-install-version
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Sep 26, 2023
1 parent 9ae4532 commit 024e277
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions home/dot_local/bin/executable_brew-install-version.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ readonly version="$2"

homebrew_core_dir="$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core"

export HOMEBREW_NO_INSTALL_FROM_API=1
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_UPDATE_REPORT_NEW=1
export HOMEBREW_NO_ENV_HINTS=1

if [[ ! -d "${homebrew_core_dir}" ]]; then
c brew tap homebrew/core
fi

c brew update --force

formula_file="$(brew info "${formula}" | grep --only-matching "Formula/.*.rb")"
Expand All @@ -22,8 +31,6 @@ fi

c git -C "${homebrew_core_dir}" reset --hard "${revision}"

export HOMEBREW_NO_AUTO_UPDATE=1

if brew list "${formula}" &>/dev/null; then
c brew uninstall --force "${formula}"
fi
Expand Down
2 changes: 2 additions & 0 deletions home/dot_local/bin/executable_full-upgrade.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ true || source ../../.chezmoitemplates/sdkman-library

if [[ "${CONTINUE_FROM_DOTFILES:-false}" == false ]]; then
if brew --version &>/dev/null; then
export HOMEBREW_NO_ENV_HINTS=1

log_task "Updating brew"
c brew update

Expand Down

0 comments on commit 024e277

Please sign in to comment.