brew update and retried your prior step?brew doctor, fixed as many issues as possible and retried your prior step?Option to suppress "already installed" warnings. The idea is to allow the user to keep a list of packages he wishes to have installed in a script file, and be able to run this script after adding new packages to install them, without getting a big list of warnings.
Redirecting stderr is not ideal because other errors should still be displayed.
Example:
#!/usr/bin/env sh
brew install --ignore-already-installed coreutils fish git mackup node python tree diff-so-fancy hub rbenv
brew cask install --ignore-already-installed iterm2 telegram google-chrome nvalt spotify imageoptim transmission the-unarchiver appcleaner flux sidestep secure-pipes cyberduck discord slack docker dropbox gitup hexfiend licecap livereload openemu postgres shiori teamviewer vlc
Your use case is really specific, and I doubt many people would use it. It doesn鈥檛 seem worth to add an extra flag for this, especially since your case could be easily solved by tweaking your script:
#!/bin/bash
hb_list=(coreutils fish git mackup node python tree diff-so-fancy hub rbenv)
hbc_list=(iterm2 telegram google-chrome nvalt spotify imageoptim transmission the-unarchiver appcleaner flux sidestep secure-pipes cyberduck discord slack docker dropbox gitup hexfiend licecap livereload openemu postgres shiori teamviewer vlc)
for item in "${hb_list[@]}"; do
brew info "${item}" | grep --quiet 'Not installed' && brew install "${item}"
done
for item in "${hbc_list[@]}"; do
brew cask info "${item}" | grep --quiet 'Not installed' && brew cask install "${item}"
done
The idea is to allow the user to keep a list of packages he wishes to have installed in a script file, and be able to run this script after adding new packages to install them, without getting a big list of warnings.
Use brew bundle for this.