dotfiles/osx/install

79 lines
2.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
source "$HOME/.dotfiles/script_helpers/printing.sh"
source "$HOME/.dotfiles/script_helpers/core.sh"
source "$HOME/.dotfiles/script_helpers/platform.sh"
source "$HOME/.dotfiles/script_helpers/file_ops.sh"
printf "\n${BOLD}Installing key remap config...${NORMAL}\n"
key_dest=$HOME/.config/karabiner/assets/complex_modifications/
mkdir -p $key_dest
make_link $HOME/.dotfiles/osx/capslock-to-ctrl-for-karabiner.json ${key_dest}/custom-capslock.json
#-----------------------------------
# Homebrew packages
#-----------------------------------
printf "\n${BOLD}Installing Homebrew packages...${NORMAL}\n\n"
brew_packages=(
'openssl'
'wget'
'git'
'rlwrap'
'cmake'
'vim'
'sdl'
'tree'
'rmtrash'
)
brew_cask_packages=(
'rectangle'
'karabiner-elements'
)
for package in "${brew_packages[@]}"
do
printf "${BOLD}$package${NORMAL}\n"
ret=$(brew list | awk /$package/)
if [[ $ret == $package ]]; then
printf "${MAGENTA}==> ${NORMAL}${YELLOW}Already installed!${NORMAL}\n\n"
else
eval "brew install $package"
printf "\n"
fi
done
for package in "${brew_cask_packages[@]}"
do
printf "${BOLD}cask/$package${NORMAL}\n\n"
ret=$(brew list | awk /$package/)
if [[ $ret == $package ]]; then
printf "${MAGENTA}==> ${NORMAL}${YELLOW}Already installed!${NORMAL}\n\n"
else
eval "brew cask 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"