Add brew shortcuts to .zshrc

A simple port of the "p" package manager, using brew, for macOS.
This commit is contained in:
2024-03-09 15:23:46 +00:00
parent af462076d7
commit 0c315770c5
2 changed files with 75 additions and 4 deletions

22
MacOS/scripts/moveAppsToBrew.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# List all installed apps
all_apps=(/Applications/*)
# Loop through each app
for app in "${all_apps[@]}"; do
# Extract the app name without the extension (if any)
app_name="${app##*/}"
app_name="${app_name%.*}" # Removes everything after the last dot
# Check if the app name exists in a brew cask
brew search $app_name &> /dev/null
if [ $? -eq 0 ]; then
echo "Found $app_name in Homebrew. Installing..."
brew install --cask --force "$app_name"
else
echo "$app_name not found in Homebrew."
fi
done
echo "All checks completed."