Skip to content

Instantly share code, notes, and snippets.

@alea12
Last active April 21, 2020 06:22
Show Gist options
  • Save alea12/206a087c266aeb326cb459c44df3ee76 to your computer and use it in GitHub Desktop.
Save alea12/206a087c266aeb326cb459c44df3ee76 to your computer and use it in GitHub Desktop.
#!/bin/zsh
function command_exists {
command -v "$1" > /dev/null;
}
# Set up Xcode
if command_exists xcode-select; then
xcode-select --install
sudo xcodebuild -license accept
fi
# Install homebrew
if ! command_exists brew; then
echo "----- Homebrew -----"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew update
brew upgrade
fi
# Install App Store Apps
if command_exists brew; then
echo "----- App Store Apps (mas) -----"
brew install mas
mas install 497799835 # Xcode
mas install 441258766 # Magnet
mas install 549083868 # Display Menu
mas install 1024640650 # CotEditor
fi
# Install GUI Apps
if command_exists brew; then
echo "----- GUI Apps (brew cask) -----"
brew cask install iterm2
brew cask install google-chrome
brew cask install google-japanese-ime
brew cask install karabiner-elements
brew cask install hyperswitch
brew cask install visual-studio-code
brew cask install tableplus
brew cask install cyberduck
brew cask install adobe-creative-cloud
brew cask install microsoft-office
brew cask install vlc
fi
# Install CLI Apps
if command_exists brew; then
echo "----- CLI Apps (brew) -----"
brew tap heroku/brew
brew install vim
brew install wget
brew install unar
brew install heroku
brew install mysql
brew install redis
brew install postgresql
brew services start mysql
brew services start redis
brew services start postgresql
fi
# Ruby
if command_exists brew; then
echo "----- Ruby (rbenv) -----"
brew install rbenv ruby-build
ruby_latest=$(rbenv install --list | grep -v '[a-z]' | tail -1 | sed 's/ //g')
rbenv install $ruby_latest
rbenv global $ruby_latest
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc
gem install bundler
fi
# NodeJS
if command_exists brew; then
echo "----- NodeJS (nodenv) -----"
brew install nodenv node-build
echo 'eval "$(nodenv init -)"' >> ~/.zshrc
source ~/.zshrc
node_latest=$(nodenv install --list | grep -v '[a-z]' | tail -1 | sed 's/ //g')
nodenv install $node_latest
nodenv global $node_latest
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment