From 977edd5f4affebfda170192e1d9769e61420093b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Alem=C3=A1n?= Date: Fri, 5 Apr 2024 09:08:40 -0500 Subject: [PATCH] fix: check if mac apps installed before installation --- mac | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mac b/mac index 2fe3b59..190f1e0 100755 --- a/mac +++ b/mac @@ -127,15 +127,19 @@ brew "zlib" # Databases brew "mysql-client@5.7", link: true brew "libpq", link: true +EOF # Mac apps -cask "1password" -cask "docker" -cask "google-chrome" -cask "iterm2" -cask "rectangle" -cask "slack" -EOF +apps=(1password docker google-chrome iterm2 rectangle slack) +app_paths=(1Password.app Docker.app "Google Chrome.app" iTerm.app Rectangle.app Slack.app) + +for i in "${!apps[@]}"; do + fancy_echo "Installing ${apps[$i]} ..." + if [ ! -d "/Applications/${app_paths[$i]}" ]; then + brew install --cask "${apps[$i]}" + fi + echo "${apps[$i]} installed." +done if [ ! -d "$HOME/.asdf" ]; then fancy_echo "Installing asdf version manager ..."