Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 637 Bytes

File metadata and controls

35 lines (29 loc) · 637 Bytes

Why

Homebrew/brew#3933

Homebrew/brew#3716

git clone https://github.com/remo5000/brew-add.git
cp brew-add/brew-add.rb /usr/local/bin/

Why not use a shell script??

Knock yourself out:

brew() {
  case $1 in
    add)
      shift
      for formula in "$@"
      do
        echo "Adding $formula to Brewfile"
        if ! grep -q "\"$formula\"" ~/Brewfile; then
          echo "brew \"$formula\"" >> ~/Brewfile;
        fi
      done
      echo "Installing..."
      brew bundle install --file ~/Brewfile;
      ;;
    *)
      command brew "$@";;
  esac
}