<commit_before>#!/usr/bin/env bash

# Start in the directory where this script is located
pushd "$(dirname "${BASH_SOURCE}")" 1> /dev/null;

# Load Helper Functions
source ./functions.sh;

# Display banner
h1 "Homebrew";

# Packages to install
brews=(
  git
  node
  z
  wget
)

casks=(
  1password
  bitcasa
  dropbox
  evernote
  flash
  google-chrome
  hazel
  sublime-text3
  sourcetree
  path-finder
)

# charles crashplan deltawalker disk-inventory-x eclipse-jee heroku-toolbelt kaleidoscope logitech-myharmony mamp microsoft-office omnifocus omnigraffle transmit vmware-fusion

### DO SOMETHING ###

# Ask for the administrator password upfront.
sudo -v

# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &


info "Install / Upgrade Homebrew";

function install_homebrew() {
  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  # Check/fix installation problems
  set +e
  brew doctor
  set -e

  # Setup casks
  brew install caskroom/cask/brew-cask
  brew tap caskroom/versions

  # Update formulae
  brew update
}

# Install Homebrew

set +e
which brew > /dev/null 2>&1
RET=$?
set -e
if [[ $RET -ne 0 ]]; then
  readp "Install Homebrew package manager (y/N)? " RESPONSE;
  if [[ "$RESPONSE" == "y" ]]; then
    install_homebrew
  fi
else
  echo "Homebrew is already installed, skipping install."
  brew update;
fi

info "Install / Upgrade Formulae";

printf "The following formulae will be installed:\n";
printf ' - %s\n' "${brews[@]}";<commit_msg>Update brew & cask packages to install<commit_after>#!/usr/bin/env bash

# Start in the directory where this script is located
pushd "$(dirname "${BASH_SOURCE}")" 1> /dev/null;

# Load Helper Functions
source ./functions.sh;

# Display banner
h1 "Homebrew";

# Packages to install
brews=(
	ant
	heroku-toolbelt
	maven
	mongodb
	perforce
	tomcat
  git
  node
  wget
  z
)

casks=(
  1password
  dropbox
  eclipse-jee
  evernote
  google-chrome
  hazel
  java
  path-finder
  sourcetree
  sublime-text3
)

# charles crashplan deltawalker disk-inventory-x eclipse-jee heroku-toolbelt kaleidoscope logitech-myharmony mamp microsoft-office omnifocus omnigraffle transmit vmware-fusion

### DO SOMETHING ###

# Ask for the administrator password upfront.
sudo -v

# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &


info "Install / Upgrade Homebrew";

function install_homebrew() {
  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  # Check/fix installation problems
  set +e
  brew doctor
  set -e

  # Setup casks
  brew install caskroom/cask/brew-cask
  brew tap caskroom/versions

  # Update formulae
  brew update
}

# Install Homebrew

set +e
which brew > /dev/null 2>&1
RET=$?
set -e
if [[ $RET -ne 0 ]]; then
  readp "Install Homebrew package manager (y/N)? " RESPONSE;
  if [[ "$RESPONSE" == "y" ]]; then
    install_homebrew
  fi
else
  echo "Homebrew is already installed. Updating existing installation."
  brew update;
fi

info "Install / Upgrade Formulae";

printf "The following formulae will be installed:\n";
printf ' - %s\n' "${brews[@]}";
{'fraction_non_alphanumeric': 0.10966767371601209, 'fraction_numerical': 0.006646525679758308, 'mean_word_length': 3.6831683168316833, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2424247', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1128, 'n_words': 367}