-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrew-all.sh
29 lines (26 loc) · 982 Bytes
/
brew-all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Check if Homebrew is installed
if ! command -v brew &> /dev/null; then
echo "Error: Homebrew is not installed. Please install Homebrew before running this script."
exit 1
fi
# Tap the Homebrew cask-fonts repository
echo "Tapping Homebrew cask-fonts repository..."
if ! brew tap homebrew/cask-fonts; then
echo "Error: Failed to tap the Homebrew cask-fonts repository."
exit 1
fi
echo "Homebrew cask-fonts repository tapped successfully."
# Install Nerd Font packages
echo "Installing Nerd Font packages..."
font_packages=$(brew search '/font-.*-nerd-font/' | awk '{ print $1 }')
successful_installations=0
for package in $font_packages; do
if ! brew install --cask "$package"; then
echo "Warning: Failed to install $package. Continuing with the next package."
else
echo "Installed $package successfully."
((successful_installations++))
fi
done
echo "Nerd Font packages installed. $successful_installations packages installed successfully."