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 "#-------------------------------"