Skip to content
Snippets Groups Projects
Unverified Commit 2a297150 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

cmd/formulae.sh: improve and refactor.

parent 28320486
No related branches found
No related tags found
No related merge requests found
......@@ -5,9 +5,24 @@
homebrew-formulae() {
local formulae
formulae="$(find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' |\
sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')"
formulae="$( \
find "$HOMEBREW_REPOSITORY/Library/Taps" \
-type d \( \
-name Casks -o \
-name cmd -o \
-name .github -o \
-name lib -o \
-name spec -o \
-name vendor \
\) \
-prune -false -o -name '*\.rb' | \
sed -E -e 's/\.rb//g' \
-e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' \
-e 's|/Formula/|/|' \
)"
local shortnames
shortnames="$(echo "$formulae" | cut -d / -f 3)"
echo -e "$formulae \n $shortnames" | grep -v '^homebrew/' | sort -uf
shortnames="$(echo "$formulae" | cut -d "/" -f 3)"
echo -e "$formulae \n $shortnames" | \
grep -v '^homebrew/core' | \
sort -uf
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment