Instantly share code, notes, and snippets.

What would you like to do?
Brew Install My Dev Environment for macOS High Sierra - Slack, Docker, iTerm, IntelliJ, Google, SourceTree, Spotify, etc.
## Install applications via brew cask
brew_install() {
execute="$(brew cask install $1 2>&1)"
case $execute in
*Warning*|*Error*) echo "Warning while installing $1: $execute" ;;
*successfully*) echo "$execute \n Installed $1." ;;
*) echo "$execute \n Something went wrong while installing $1." ;;
check_before_install() {
## Test for existence of the application
if [[ -n $(find $APP_FOLDER_LOCATION -iname $ ]]; then
echo "$1 is already installed. Run - brew cask reinstall <cask-name> - to resinstall the cask."
case $1 in
Slack) brew_install slack;;
Docker) brew_install docker;;
iTerm) brew_install iterm2;;
Google\ Chrome) brew_install google-chrome;;
IntelliJ\ Idea) brew_install intellij-idea;;
Sourcetree) brew_install sourcetree;;
Spotify) brew_install spotify;;
Sequel\ Pro) brew_install sequel-pro;;
Visual\ Studio\ Code) brew_install visual-studio-code;;
*) echo "Add $1 to check_before_install() to install additional applications." ;;
## Add the application name to the switch case statement, then pass the cask-name to the brew_install function
## For example: Skype) brew_install skype
## Search for brew casks at
# Install Terraform
execute="$(brew install terraform 2>&1)"
case $execute in
*brew\ link*)
echo $execute
read -r -p "${1:-Terraform already exists, would you like to overwrite it? [y/N]} " response
case "$response" in
$(brew link --overwrite terraform);;
echo "Not overwriting terraform.";;
*Warning*|*Error*) echo $execute ;;
*Summary*) echo "$execute \n Installed Terraform." ;;
*) echo "$execute \n Something went wrong while installing $1." ;;
# Install homebrew
install_homebrew_if_not_present() {
echo "Checking for homebrew installation"
which -s brew
if [[ $? != 0 ]] ; then
echo "Homebrew not found. Installing..."
ruby -e "$(curl -fsSL"
echo "Homebrew already installed! Updating..."
brew update
# Main body of script starts here
## Install brew and brew cask
brew update
brew tap caskroom/cask
brew tap caskroom/versions
brew doctor
## Applications we will install with `brew cask install`
## additional applications can be added here if you wish to install them
declare -a applications=( Spotify Sourcetree Slack Docker iTerm "IntelliJ Idea" "Google Chrome" "Sequel Pro" "Visual Studio Code" )
## Check if the application is already installed, install if it's not
for element in ${applications[*]}
check_before_install $element
## Install Terraform
## Install other miscellaneous tools
brew install git
brew install python #python 3
brew install pyenv
brew install node
brew install coreutils
brew cask install java8
#brew cask install java || if you want the latest version of java
brew install maven
brew install awscli
npm install -g serverless
brew install packer
brew install python2 #python2.7
brew install telnet
## Install oh-my-zsh for iTerm
sh -c "$(curl -fsSL"

This comment has been minimized.

Copy link

lopezm1 commented Apr 5, 2018

Installs: Slack, Docker, iTerm, IntelliJ, Google, SourceTree, Spotify, git, python, node, java8, coreutils and Terraform


This comment has been minimized.

Copy link

lopezm1 commented Apr 24, 2018

installs maven, awscli, serverless, packer, py2, telnet


This comment has been minimized.

Copy link

rroman81 commented Apr 27, 2018

you should probably add phpStorm to the mix as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment