mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-15 19:56:59 +08:00
Declare local variables seperately, split up line for readability.
This commit is contained in:
parent
7102cc84b9
commit
917b4b964f
@ -3,9 +3,11 @@
|
|||||||
#: List all locally installable formulae including short names.
|
#: List all locally installable formulae including short names.
|
||||||
#:
|
#:
|
||||||
|
|
||||||
# shellcheck disable=SC2155
|
|
||||||
homebrew-formulae() {
|
homebrew-formulae() {
|
||||||
local 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/|/|')"
|
local formulae
|
||||||
local shortnames="$(echo "$formulae" | \cut -d / -f 3)"
|
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/|/|')"
|
||||||
|
local shortnames
|
||||||
|
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/' | \sort -uf
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user