Skip to content

Commit

Permalink
install_brewfile: Add check if mas is installed
Browse files Browse the repository at this point in the history
- Add a check to see if mas is already installed
- Move echo inside this logic
  • Loading branch information
0xmachos committed Apr 24, 2024
1 parent efedbbd commit ccbdf3a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions bittersweet
Original file line number Diff line number Diff line change
Expand Up @@ -912,14 +912,21 @@ function install_brewfile {
# Install Homebrew packages from dotfiles/.extra/Brewfile
# Will install programs from the Mac AppStore if user is logged in

echo "[🍺] Installing mas"
if ! [[ -x "$(command -v mas)" ]]; then

echo "[🍺] Installing mas"

if brew install mas 2>/dev/null; then
echo "[✅] Installed mas"
else
echo "[❌] Failed to install mas"
return 1
fi

if brew install mas 2>/dev/null; then
echo "[✅] Installed mas"
else
echo "[❌] Failed to install mas"
return 1
fi
echo "[🍺] mas already installed"
fi


declare -x HOMEBREW_BREWFILE="${dir}/.extra/Brewfile"
echo "[🍺] Exported HOMEBREW_BREWFILE=${HOMEBREW_BREWFILE}"
Expand Down

0 comments on commit ccbdf3a

Please sign in to comment.