From 42204c5c9b90ac9771a83eedbdc100c7438eda2c Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Fri, 11 Mar 2016 19:49:30 +0000 Subject: [PATCH] Move cask-tidy out to its own script. --- bin/cask-tidy | 18 ++++++++++++++++++ bin/software-install.sh | 19 ------------------- 2 files changed, 18 insertions(+), 19 deletions(-) create mode 100755 bin/cask-tidy diff --git a/bin/cask-tidy b/bin/cask-tidy new file mode 100755 index 0000000..420ee5a --- /dev/null +++ b/bin/cask-tidy @@ -0,0 +1,18 @@ +#!/bin/bash + +function __remove-cask { + caskBasePath="/opt/homebrew-cask/Caskroom" + local cask="$1" + local caskDirectory="$caskBasePath/$cask" + local versionsToRemove="$(ls -r $caskDirectory | sed 1,1d)" + if [[ -n $versionsToRemove ]]; then + while read versionToRemove ; do + echo "Removing $cask $versionToRemove..." + rm -rf "$caskDirectory/$versionToRemove" + done <<< "$versionsToRemove" + fi +} + +while read cask; do + __remove-cask "$cask" +done <<< "$(brew cask list)" diff --git a/bin/software-install.sh b/bin/software-install.sh index 24a30ea..a4f954b 100755 --- a/bin/software-install.sh +++ b/bin/software-install.sh @@ -62,25 +62,6 @@ function install_osx_software { #------------------------------- } -function __remove-cask { - caskBasePath="/opt/homebrew-cask/Caskroom" - local cask="$1" - local caskDirectory="$caskBasePath/$cask" - local versionsToRemove="$(ls -r $caskDirectory | sed 1,1d)" - if [[ -n $versionsToRemove ]]; then - while read versionToRemove ; do - echo "Removing $cask $versionToRemove..." - rm -rf "$caskDirectory/$versionToRemove" - done <<< "$versionsToRemove" - fi -} - -function cask-tidy { - while read cask; do - __remove-cask "$cask" - done <<< "$(brew cask list)" -} - echo "#-------------------------------" echo "# START: $(date)" echo "#-------------------------------"