2020-07-25 23:39:09 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
if which tput >/dev/null 2>&1; then
|
2020-07-26 17:58:29 +00:00
|
|
|
ncolors=$(tput colors)
|
2020-07-25 23:39:09 +00:00
|
|
|
fi
|
|
|
|
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
|
2020-07-26 17:58:29 +00:00
|
|
|
RED="$(tput setaf 1)"
|
|
|
|
GREEN="$(tput setaf 2)"
|
|
|
|
YELLOW="$(tput setaf 3)"
|
|
|
|
BLUE="$(tput setaf 4)"
|
|
|
|
MAGENTA="$(tput setaf 5)"
|
|
|
|
CYAN="$(tput setaf 6)"
|
|
|
|
BOLD="$(tput bold)"
|
|
|
|
NORMAL="$(tput sgr0)"
|
2020-07-25 23:39:09 +00:00
|
|
|
else
|
2020-07-26 17:58:29 +00:00
|
|
|
RED=""
|
|
|
|
GREEN=""
|
|
|
|
YELLOW=""
|
|
|
|
BLUE=""
|
|
|
|
MAGENTA=""
|
|
|
|
CYAN=""
|
|
|
|
BOLD=""
|
|
|
|
NORMAL=""
|
2020-07-25 23:39:09 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
printf "Installing env...\n"
|
|
|
|
ln -sf $HOME/.dotfiles/osx/env.platform $HOME/.env.platform
|
|
|
|
|
|
|
|
printf "Installing Git customizations...\n"
|
|
|
|
ln -sf $HOME/.dotfiles/osx/gitconfig.platform $HOME/.gitconfig.platform
|
|
|
|
|
|
|
|
#-----------------------------------
|
|
|
|
# Homebrew packages
|
|
|
|
#-----------------------------------
|
|
|
|
|
|
|
|
printf "Installing Homebrew...\n"
|
|
|
|
|
|
|
|
brew_packages=(
|
|
|
|
'openssl'
|
|
|
|
'wget'
|
|
|
|
'git'
|
|
|
|
'rlwrap'
|
|
|
|
'cmake'
|
|
|
|
'vim'
|
|
|
|
'sdl'
|
|
|
|
'tree'
|
|
|
|
)
|
|
|
|
brew tap homebrew/core
|
|
|
|
for package in "${brew_packages[@]}"
|
|
|
|
do
|
|
|
|
printf "Installing $package...\n"
|
|
|
|
ret=$(brew list | awk /$package/)
|
|
|
|
if [[ $ret == $package ]]; then
|
|
|
|
printf "${YELLOW}Already installed!${NORMAL}\n"
|
|
|
|
else
|
|
|
|
eval "brew install $package"
|
|
|
|
printf \n
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# We have issues downloading Rust on 10.11 with the patched Homebrew checkout
|
|
|
|
# so we'll install it using their script.
|
|
|
|
bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs)"
|
|
|
|
|
|
|
|
# For Vim search
|
|
|
|
cargo install ripgrep
|
|
|
|
|
|
|
|
# The homebrew core ctags package is very old.
|
|
|
|
brew install --HEAD universal-ctags/universal-ctags/universal-ctags
|
|
|
|
|
|
|
|
printf "\n${YELLOW}If you haven't already installed the Xcode dev tools then do so now by installing Xcode from the App Store:${NORMAL}\n"
|
|
|
|
printf "When that finishes open a terminal and run the following:\n"
|
|
|
|
printf " 1. ${YELLOW}sudo xcode-select --install${NORMAL}\n"
|
|
|
|
printf " 2. ${YELLOW}sudo xcodebuild -license${NORMAL}\n"
|
|
|
|
printf " 3. ${YELLOW}sudo xcode-select -s /Applications/Xcode.app/Contents/Developer${NORMAL}\n"
|
|
|
|
|
|
|
|
printf "\n${BOLD}Finished setting up OS X${NORMAL}\n"
|