From 3adb0f924a204f586ea4981dfdfbb17fb2eda02d Mon Sep 17 00:00:00 2001 From: Lynda Wang Date: Sun, 2 Aug 2020 14:33:59 -0400 Subject: [PATCH] Add more Homebrew packages --- osx/install | 65 +++++++++++++++++++++++++------------------------ osx/pre_install | 2 ++ 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/osx/install b/osx/install index 729dde6..d9a0288 100755 --- a/osx/install +++ b/osx/install @@ -1,41 +1,25 @@ #!/usr/bin/env bash -if which tput >/dev/null 2>&1; then - ncolors=$(tput colors) -fi -if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then - 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)" -else - RED="" - GREEN="" - YELLOW="" - BLUE="" - MAGENTA="" - CYAN="" - BOLD="" - NORMAL="" -fi - set -e -printf "Installing env...\n" -ln -sf $HOME/.dotfiles/osx/env.platform $HOME/.env.platform +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 "Installing Git customizations...\n" -ln -sf $HOME/.dotfiles/osx/gitconfig.platform $HOME/.gitconfig.platform +printf "${BOLD}Installing env...${NORMAL}\n" +setup_file $HOME/.dotfiles/osx/env.platform $HOME/.env.platform + +printf "\n${BOLD}Installing Git customizations...${NORMAL}\n" +setup_file $HOME/.dotfiles/osx/gitconfig.platform $HOME/.gitconfig.platform #----------------------------------- # Homebrew packages #----------------------------------- -printf "Installing Homebrew...\n" +printf "\n${BOLD}Installing Homebrew packages...${NORMAL}\n\n" + +#brew tap homebrew/core brew_packages=( 'openssl' @@ -48,16 +32,33 @@ brew_packages=( 'tree' 'rmtrash' ) -brew tap homebrew/core + +brew_cask_packages=( + 'rectangle' + 'karabiner-elements' +) + for package in "${brew_packages[@]}" do - printf "Installing $package...\n" + printf "${BOLD}$package${NORMAL}\n" ret=$(brew list | awk /$package/) if [[ $ret == $package ]]; then - printf "${YELLOW}Already installed!${NORMAL}\n" + printf "${MAGENTA}==> ${NORMAL}${YELLOW}Already installed!${NORMAL}\n\n" else eval "brew install $package" - printf \n + 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 diff --git a/osx/pre_install b/osx/pre_install index 4058667..a2c456c 100755 --- a/osx/pre_install +++ b/osx/pre_install @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# This is meant to be called from the main dotfiles install script. + if which tput >/dev/null 2>&1; then ncolors=$(tput colors) fi