Brew: Option to suppress "already installed" warnings

Created on 16 Mar 2017  路  2Comments  路  Source: Homebrew/brew

  • [x] Ran brew update and retried your prior step?
  • [x] Ran brew doctor, fixed as many issues as possible and retried your prior step?
  • [x] Confirmed this is a problem with Homebrew/brew and not specific formulae? If it's a formulae-specific problem please file this issue at https://github.com/Homebrew/homebrew-core/issues/new

Propose a feature:

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

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JustinTArthur picture JustinTArthur  路  3Comments

fxcoudert picture fxcoudert  路  3Comments

JaKXz picture JaKXz  路  3Comments

zelsonia picture zelsonia  路  4Comments

cfredhart picture cfredhart  路  4Comments