From 56cbda618418c29b254e50e1fd2527156602da94 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 5 May 2017 10:06:09 +0100 Subject: [PATCH] Convert homebrew and caskroom boostraps to standalone executables --- shell/caskroom.sh => bin/bootstrap-caskroom | 133 +++++++++++--------- bin/bootstrap-homebrew | 43 +++++++ shell/_main.sh | 2 - shell/homebrew.sh | 42 ------- 4 files changed, 115 insertions(+), 105 deletions(-) rename shell/caskroom.sh => bin/bootstrap-caskroom (67%) mode change 100644 => 100755 create mode 100755 bin/bootstrap-homebrew delete mode 100644 shell/homebrew.sh diff --git a/shell/caskroom.sh b/bin/bootstrap-caskroom old mode 100644 new mode 100755 similarity index 67% rename from shell/caskroom.sh rename to bin/bootstrap-caskroom index 915a9be..e38fb66 --- a/shell/caskroom.sh +++ b/bin/bootstrap-caskroom @@ -1,105 +1,116 @@ -# -# Caskroom related stuff. -# +#! /usr/bin/env bash +set -e -bootstrap_caskroom() { - local pkgs=( +pkgs=() + +if [[ " $@ " == " home " ]]; then + pkgs+=( adium-beta - aerial - alfred android-file-transfer - appcleaner - atom audio-hijack autodmg - bartender - betterzip bowtie calibre carbon-copy-cloner - chicken cloudup daisydisk deluge discord - docker-beta dropbox ethereum-wallet filebot + gog-galaxy + gpgtools + hackety-hack + handbrake + irccloud + keybase + little-snitch + logitech-options + makemkv + messenger + micro-snitch + mist + omnigraffle + openemu + parallels-desktop + plex-media-player + ring + screenhero + sixtyforce + skype + spotify + synology-assistant + teamviewer + transmission + unetbootin + virtualbox + virtualc64 + viscosity + vmware-fusion + witgui + xld + yakyak + ynab + ) +fi + +if [[ " $@ " == " work " ]]; then + pkgs+=( + aerial + alfred + appcleaner + atom + bartender + bbedit + betterzip + chicken + docker firefox fluid flux github-desktop - gog-galaxy google-cloud-sdk google-chrome - gpgtools - hackety-hack - handbrake + hipchat insomnia - irccloud istat-menus istumbler iterm2 java karabiner-elements - keybase licecap - little-snitch - logitech-options - mailplane - makemkv - messenger - micro-snitch - mist + medis moom mplayerx - omnigraffle - openemu - parallels-desktop paw - plex-media-player postman + qlstephen resolutionator - ring - screenhero sequel-pro - sixtyforce - skype - spotify stay - synology-assistant - teamviewer - transmission ubersicht - unetbootin - virtualbox - virtualc64 - viscosity visual-studio-code vlc - vmware-fusion - witgui - wmail - xld - yakyak - ynab ) +fi - local installed=( $(brew cask list) ) +installed=( $(brew cask list) ) - for pkg in ${pkgs[@]}; do - local base=$(echo $pkg | awk '{print $1}') - local found="" +for pkg in "${pkgs[@]}"; do + base=$(echo $pkg | awk '{print $1}') + found="" - for i in ${installed[@]}; do - if [[ "$base" == "$i" ]]; then - found=1 - fi - done - - if [ -z "$found" ]; then - brew cask install "${pkg[@]}" + for i in ${installed[@]}; do + if [[ "$base" == "$i" ]]; then + found=1 fi done -} + + if [ -z "$found" ]; then + echo "--> Missing: ${base}" + brew cask install ${pkg[@]} + else + echo "--> Installed: ${base}" + fi +done diff --git a/bin/bootstrap-homebrew b/bin/bootstrap-homebrew new file mode 100755 index 0000000..9ecd215 --- /dev/null +++ b/bin/bootstrap-homebrew @@ -0,0 +1,43 @@ +#! /usr/bin/env bash +set -e + +pkgs=( + ack + "aspell --with-lang-en --with-lang-el --with-lang-sv" + bash + bazaar + git + heroku + htop + kubernetes-cli + mysql + peco + readline + reattach-to-user-namespace + redis + tccutil + the_silver_searcher + tmux + wget + zsh +) + +installed=( $(brew list) ) + +for pkg in "${pkgs[@]}"; do + base=$(echo $pkg | awk '{print $1}') + found="" + + for i in ${installed[@]}; do + if [[ "$base" == "$i" ]]; then + found=1 + fi + done + + if [ -z "$found" ]; then + echo "--> Missing: ${base}" + brew install ${pkg[@]} + else + echo "--> Installed: ${base}" + fi +done diff --git a/shell/_main.sh b/shell/_main.sh index 92579ba..0658c21 100755 --- a/shell/_main.sh +++ b/shell/_main.sh @@ -25,8 +25,6 @@ fi # Package management source "$DOTSHELL/nix.sh" -source "$DOTSHELL/homebrew.sh" -source "$DOTSHELL/caskroom.sh" # Aliases source "$DOTSHELL/aliases.sh" diff --git a/shell/homebrew.sh b/shell/homebrew.sh deleted file mode 100644 index e3452ff..0000000 --- a/shell/homebrew.sh +++ /dev/null @@ -1,42 +0,0 @@ -# -# Homebrew related stuff. -# - -bootstrap_homebrew () { - local pkgs=( - ack - "aspell --with-lang-en --with-lang-el --with-lang-sv" - bash - bazaar - git - heroku - htop - kubernetes-cli - mysql - peco - readline - reattach-to-user-namespace - redis - the_silver_searcher - tmux - wget - zsh - ) - - local installed=( $(brew list) ) - - for pkg in ${pkgs[@]}; do - local base=$(echo $pkg | awk '{print $1}') - local found="" - - for i in ${installed[@]}; do - if [[ "$base" == "$i" ]]; then - found=1 - fi - done - - if [ -z "$found" ]; then - brew install "${pkg[@]}" - fi - done -}