From 85feb9bae61d2d9ea31ac5ee18fad5fd0aab62ab Mon Sep 17 00:00:00 2001 From: gvatsal60 <40350810+gvatsal60@users.noreply.github.com> Date: Sun, 27 Sep 2026 08:38:54 +0000 Subject: [PATCH] refactor: improve brew command detection in .update.sh Update the `update_brew` function to explicitly locate the brew executable. This adds support for detecting brew in the default Linuxbrew path (`/home/linuxbrew/.linuxbrew/bin/brew`) when it is not found in the standard PATH, ensuring more reliable execution in various environments. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> --- .update.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.update.sh b/.update.sh index 574b408..824602f 100755 --- a/.update.sh +++ b/.update.sh @@ -216,13 +216,18 @@ update_os_pkg() { update_brew() { println "Update Brew Formula's" - if ! check_command brew; then + _brew_path=$(command -v brew 2>/dev/null) + if [ -z "${_brew_path}" ] && [ -x "/home/linuxbrew/.linuxbrew/bin/brew" ]; then + _brew_path="/home/linuxbrew/.linuxbrew/bin/brew" + fi + if [ -z "${_brew_path}" ]; then + print_err "brew is not installed." return fi - brew update && brew upgrade && brew cleanup -s + "${_brew_path}" update && "${_brew_path}" upgrade && "${_brew_path}" cleanup -s println "Brew Diagnostics" - brew doctor && brew missing + "${_brew_path}" doctor && "${_brew_path}" missing } # Function: update_vscode_ext