FelixKratz / SketchyBar

A highly customizable macOS status bar replacement
https://felixkratz.github.io/SketchyBar/
GNU General Public License v3.0
6.64k stars 97 forks source link

"brew upgrade" command errors out when run as a click_script #653

Open Pe8er opened 2 weeks ago

Pe8er commented 2 weeks ago

I have a item/plugin that runs brew update && brew upgrade on click. Item code:

#!/usr/bin/env zsh

# Load global styles, colors and icons
source "$CONFIG_DIR/globalstyles.sh"

# Identify full path to brew, just in case
brew="$(which brew)"

brew=(
  "${notification_defaults[@]}"
  icon=$ICON_PACKAGE
  script="$PLUGIN_DIR/brew.sh"
  click_script="$brew update && $brew upgrade"
)

sketchybar --add item  brew right            \
           --set       brew "${brew[@]}"

Issue: when ran through Sketchybar, brew upgrade errors out when trying to download any package (it calls curl and stops). When I run brew upgrade from Terminal or a simple script file, it works.

I asked folks over at homebrew, we did some troubleshooting but nothing works so far, so I thought I'd ask here. Discussion over at homebrew:

https://github.com/orgs/Homebrew/discussions/5710