Skip to content

Instantly share code, notes, and snippets.

@jturmel
Created April 5, 2023 19:48
Show Gist options
  • Select an option

  • Save jturmel/a54ee47f93505360111139ccfed43bbe to your computer and use it in GitHub Desktop.

Select an option

Save jturmel/a54ee47f93505360111139ccfed43bbe to your computer and use it in GitHub Desktop.
macos-setup.sh
#!/bin/bash
INSTALL_FOLDER=~/.macos-setup
mkdir -p $INSTALL_FOLDER
MACOS_SETUP_PROFILE=$INSTALL_FOLDER/macos-setup_profile
# sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
if ! hash brew
then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update --auto-update
else
printf "\e[93m%s\e[m\n" "brew already installed."
fi
if ! brew info curl &>/dev/null; then
brew install curl
else
printf "\e[93m%s\e[m\n" "curl already installed."
fi
if ! brew info wget &>/dev/null; then
brew install wget
else
printf "\e[93m%s\e[m\n" "wget already installed."
fi
# git
if ! brew info git &>/dev/null; then
brew install git
else
printf "\e[93m%s\e[m\n" "git already installed."
fi
# ZSH
if ! brew info zsh &>/dev/null; then
brew install zsh zsh-completions # Install zsh and zsh completions
sudo chmod -R 755 /usr/local/share/zsh
sudo chown -R root:staff /usr/local/share/zsh
{
echo "if type brew &>/dev/null; then"
echo " FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH"
echo " autoload -Uz compinit"
echo " compinit"
echo "fi"
} >>$MACOS_SETUP_PROFILE
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"# Install oh-my-zsh on top of zsh to getting additional functionality
else
printf "\e[93m%s\e[m\n" "zsh and related items already installed."
fi
if ! brew info google-chrome &>/dev/null; then
brew install coreutils
else
printf "\e[93m%s\e[m\n" "coreutils already installed."
fi
# Browser
if ! brew info google-chrome &>/dev/null; then
brew install --cask google-chrome
else
printf "\e[93m%s\e[m\n" "Google Chrome already installed."
fi
if ! brew info firefox &>/dev/null; then
brew install --cask firefox
else
printf "\e[93m%s\e[m\n" "Firefox already installed."
fi
if ! brew info microsoft-edge &>/dev/null; then
brew install --cask microsoft-edge
else
printf "\e[93m%s\e[m\n" "Microsoft Edge already installed."
fi
# Communication
if ! brew info slack &>/dev/null; then
brew install --cask slack
else
echo "Slack already installed."
fi
if ! brew info discord &>/dev/null; then
brew install --cask discord
else
echo "Discord already installed."
fi
# IDE
if ! brew info jetbrains-toolbox &>/dev/null; then
brew install --cask jetbrains-toolbox
else
echo "JetBrains Toolbox already installed."
fi
if ! brew info warp &>/dev/null; then
brew install --cask warp
else
echo "Warp already installed."
fi
## Terraform
if ! brew info terraform &>/dev/null; then
brew install terraform
terraform -v
else
echo "Terraform already installed."
fi
# Docker
if ! brew info docker &>/dev/null; then
brew install --cask docker
brew install bash-completion
brew install docker-completion
brew install docker-compose-completion
brew install docker-machine-completion
else
echo "Docker already installed."
fi
# Google Cloud Platform
if ! brew info google-cloud-sdk &>/dev/null; then
brew install --cask google-cloud-sdk
else
echo "Google Cloud SDK already installed."
fi
# Heroku
if ! brew info heroku &>/dev/null; then
brew tap heroku/brew && brew install heroku
else
echo "Heroku already installed."
fi
# Setapp
if ! brew info setapp &>/dev/null; then
brew install --cask setapp
else
echo "Setapp already installed."
fi
# Adobe
if ! brew info adobe-creative-cloud &>/dev/null; then
brew install --cask adobe-creative-cloud
else
echo "Adobe CC already installed."
fi
# 1Password
if ! brew info 1password &>/dev/null; then
brew install --cask 1password
else
echo "1Password already installed."
fi
# Basecamp
if ! brew info basecamp &>/dev/null; then
brew install --cask basecamp
else
echo "Basecamp already installed."
fi
# Microsoft Office
if ! brew info microsoft-office &>/dev/null; then
brew install --cask microsoft-office
else
echo "Microsoft Office already installed."
fi
# SourceTree
if ! brew info sourcetree &>/dev/null; then
brew install --cask sourcetree
else
echo "Sourcetree already installed."
fi
# Synergy
if ! brew info synergy &>/dev/null; then
brew install --cask synergy
else
echo "Synergy already installed."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment