Last active
April 6, 2022 03:06
-
-
Save hazcod/fa5b9fb7cfcde52e76c76a2413bb7570 to your computer and use it in GitHub Desktop.
List all top level brew packages
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
#!/usr/bin/env bash | |
#EDIT: just use `brew leaves` | |
brew deps --installed | awk -F'[: ]+' '{ | |
packages[$1]++ | |
for (i = 2; i <= NF; i++) | |
dependencies[$i]++ | |
} | |
END { | |
for (package in packages) | |
if (!(package in dependencies)) | |
print package | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment