-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #301 from iAGorynT/iAGorynT-Code-Snippet-Changes
New Brewapps Listing
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/zsh | ||
|
||
# List Selected Application Descriptions | ||
clear | ||
echo "App Descriptions..." | ||
echo " " | ||
|
||
# Array of app names | ||
apps=("btop" "iperf3" "jq" "qlmarkdown" "macdown" "mosh" "speedtest" "balenaetcher" "github" "macvim") | ||
|
||
# Function to check if a line contains an app name | ||
contains_app() { | ||
local line=$1 | ||
for app in "${apps[@]}"; do | ||
if [[ $line == *"$app"* ]]; then | ||
echo "$line" | ||
break | ||
fi | ||
done | ||
} | ||
|
||
# Temporary file to store brew command results | ||
temp_file=$(mktemp) | ||
# Run the command and store output in a temporary file | ||
brew desc --eval-all $(brew list) | awk 'gsub(/^([^:]*?)\s*:\s*/,"&=")' | column -s "=" -t > $temp_file | ||
|
||
# Read file line by line and check for app names | ||
while IFS= read -r line; do | ||
contains_app "$line" | ||
done < $temp_file | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters