function install { which $1 &> /dev/null if [ $? -ne 0 ]; then echo "Installing: ${1}..." if [ -z ${2} ] then brew install ${1} else brew install --cask ${1} fi else echo "Already installed: ${1}" fi } cask_packages = (gimp thunderbird firefox zotero rectangle vlc iterm2 inkscape obsidian blender mactex bitwarden visual-studio-code spotify) other_packages = (neovim tmux docker docker-compose git curl zsh stow tree) brew update for package in "${cask_packages}" do install ${package} "cask" done for package in "${other_packages}" do install ${package} done