mirror of
https://github.com/gosticks/brew.git
synced 2026-09-01 06:20:24 +00:00
When running brew commands and interpreting the output, e.g. running `brew livecheck --json`, it's necessary to stop other programs Homebrew happens to execute from writing logging output to stdout. Most programs don't do this, but `bundle install` does seem to. To reproduce the issue you can run: ```shell git -C "$(brew --prefix)" clean -ffdx Library/Homebrew/vendor stdout=$(HOMEBREW_FORCE_VENDOR_RUBY=1 brew livecheck --newer-only --json --cask $(brew --repo homebrew/cask)/Casks/grid.rb) echo "^^^ was stderr, >>> is stdout: $stdout" ``` If you run it without this change it will print a bunch of output like this to the stdout before printing out the livecheck JSON output: ```text Using bundler 1.17.3 Fetching byebug 11.1.3 Fetching coderay 1.1.3 Installing byebug 11.1.3 with native extensions Installing coderay 1.1.3 Fetching colorize 0.8.1 Installing colorize 0.8.1 [ # Contents of the JSON block. ] ``` With this change the stdout from `bundle install` will be redirected to brew's stderr, meaning only the JSON goes to stdout, and the rest goes to stderr.