cmd/formulae.sh: improve and refactor.
This commit is contained in:
parent
2832048692
commit
2a29715042
@ -5,9 +5,24 @@
|
|||||||
|
|
||||||
homebrew-formulae() {
|
homebrew-formulae() {
|
||||||
local formulae
|
local formulae
|
||||||
formulae="$(find "$HOMEBREW_REPOSITORY"/Library/Taps -type d \( -name Casks -o -name cmd -o -name .github \) -prune -false -o -name '*rb' |\
|
formulae="$( \
|
||||||
sed -E -e 's/\.rb//g' -e 's_.*/Taps/(.*)/(home|linux)brew-_\1/_' -e 's|/Formula/|/|')"
|
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
|
local shortnames
|
||||||
shortnames="$(echo "$formulae" | cut -d / -f 3)"
|
shortnames="$(echo "$formulae" | cut -d "/" -f 3)"
|
||||||
echo -e "$formulae \n $shortnames" | grep -v '^homebrew/' | sort -uf
|
echo -e "$formulae \n $shortnames" | \
|
||||||
|
grep -v '^homebrew/core' | \
|
||||||
|
sort -uf
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user