diff --git a/home/.chezmoitemplates/homebrew-library b/home/.chezmoitemplates/homebrew-library index 4638bfd..79821c3 100644 --- a/home/.chezmoitemplates/homebrew-library +++ b/home/.chezmoitemplates/homebrew-library @@ -4,3 +4,18 @@ readonly home_homebrew_prefix="${HOME}/.linuxbrew" readonly root_homebrew_prefix="/home/linuxbrew/.linuxbrew" ensure_path_entry "${home_homebrew_prefix}/bin" "${root_homebrew_prefix}/bin" + +# https://github.com/Homebrew/brew/issues/17905#issuecomment-3342150232 +function faketty() { + local _system + _system="$(uname -s)" + if [[ ${_system} == Darwin ]]; then + script -qF /dev/null "$(printf "%q " "$@")" + else + script -qefc "$(printf "%q " "$@")" /dev/null + fi +} + +function brew() { + faketty brew "${@}" +} diff --git a/home/dot_local/bin/executable_full-upgrade.tmpl b/home/dot_local/bin/executable_full-upgrade.tmpl index 95fcaa2..4bf9fb9 100644 --- a/home/dot_local/bin/executable_full-upgrade.tmpl +++ b/home/dot_local/bin/executable_full-upgrade.tmpl @@ -12,6 +12,9 @@ true || source ../../.chezmoitemplates/volta-library ensure_path_entry "${HOME}/.local/bin" if [[ "${CONTINUE_FROM_DOTFILES:-false}" == false ]]; then + # Request password early if needed + sudo true + if brew --version &>/dev/null; then ( export HOMEBREW_NO_AUTO_UPDATE=1